Comments (4)
hi, there is a function called write_STL
that does exactly this. You can find it in cinolib/io/write_STL.h
from cinolib.
But currently I am using trimesh.save()
to create the stl which as far as I can tell from the source code uses the write_STL
function you mention. However, the normals seem to have been randomly oriented and not consistently outwards.
from cinolib.
A tiny clarification: if you load a method with inconsistent normals and then you save it as an STL... you'll just propagate the same inconsistent normals in the new file! There's no magic in the save method.
Perhaps what you need is an algorithm to re-orient a badly oriented discrete surface? I do not have it in cinolib, but it should be fairly easy for you to code one. You just have to start from a trusted triangle (e.g. the first triangle you intersect from a ray coming from the outside), fix that normal, and then propagate the same orientation to the adjacent elements via flooding. If the surface is orientable, the algorithm converges to a consistent mesh orientation. If it is not, you will try to assign an opposite normal to a triangle you already visited, and by then you would know that your surface is non-orientable (e.g. a Mobius strip)
from cinolib.
Thanks for the clarification, I was asking mostly hoping it would not be necessary to implement it or use some other library for it, but alas, there is no other option.
from cinolib.
Related Issues (20)
- cut mesh HOT 3
- Mesh duality: m_poly faces not planar nor perpendicular to the corresponding m_tet edge HOT 7
- Undefined reference to `orient2d' / `orient3d' HOT 1
- how to use the hex_transition_install function? HOT 1
- transform and bake_rotation_matrix undefined in hex_transition_orient.cpp HOT 1
- Is it possible to offset a mesh preserving its sharp edges? HOT 6
- How to generate a cinolib? HOT 2
- Cut a volume mesh based on embedded level set HOT 15
- no member named 'update_hex_quality' HOT 3
- OpenGL rendering: soft shadows HOT 3
- How to use remesh_Botsch_Kobbelt_2004 without gl HOT 3
- Custom data in Tetmesh HOT 1
- All-hexahedral meshing? HOT 1
- Shadow casting question HOT 5
- Embed a polyline into a mesh HOT 4
- error when run sliced_CLI_loader HOT 1
- CMD + click ,What button is cmd in surface_painter project HOT 1
- Storing Surface Painter output HOT 3
- Interactive Selection in the viewer HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cinolib.