Mesh.Mesh((pts,triangles)) does not produce all faces when I have large triangles.
My workaround at the moment is the creation af mutliple meshes and then
bigMesh.addMesh(addonMesh)
Are there some limitations on these commands Ishould know or can this be a bug?
can I get diagnostic information why some triangles are not created?
Mesh creation loses triangles.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Mesh creation loses triangles.
The method addFacets (also used inside Mesh.Mesh()) checks for non-manifolds edge and filter out the affected triangles while addMesh doesn't do this check because it expects that the two meshes don't overlap.
The field of application the mesh data structure was designed for it is important to avoid non-manifolds, self-intersections, ... Now when creating a mesh from CAD shapes it pretty often happens that the data structure has non-manifolds.
If your input data is a shape then you can use
We can also think about adding a further parameter to addFacets to switch off the error checking.
The field of application the mesh data structure was designed for it is important to avoid non-manifolds, self-intersections, ... Now when creating a mesh from CAD shapes it pretty often happens that the data structure has non-manifolds.
If your input data is a shape then you can use
Code: Select all
mesh=MeshPart.meshFromShape(shape, deviation)
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Mesh creation loses triangles.
Thank you, my error diet only occur when I merged horzontal and vertical faces, so there will be the error and I can look for it.wmayer wrote: The field of application the mesh data structure was designed for it is important to avoid non-manifolds, self-intersections, ... Now when creating a mesh from CAD shapes it pretty often happens that the data structure has non-manifolds.
This is a nice idea because I need the mesh only for fast rendering.
We can also think about adding a further parameter to addFacets to switch off the error checking.
Re: Mesh creation loses triangles.
This now switches off the manifold check. git commit f560398
Code: Select all
from FreeCAD import Vector
m=([Vector (0.0, 10.0, 10.0), Vector (0.0, 10.0, 0.0), Vector (0.0, 0.0, 10.0),
Vector (0.0, 0.0, 0.0), Vector (10.0, 0.0, 10.0), Vector (10.0, 10.0, 0.0),
Vector (10.0, 10.0, 10.0), Vector (10.0, 0.0, 0.0), Vector (10.0, 20.0, 10.0),
Vector (10.0, 20.0, 0.0), Vector (20.0, 10.0, 10.0), Vector (20.0, 20.0, 0.0),
Vector (20.0, 20.0, 10.0), Vector (20.0, 10.0, 0.0)],
[(0, 1, 2), (1, 3, 2), (4, 5, 6), (4, 7, 5), (3, 7, 4), (2, 3, 4),
(6, 5, 1), (6, 1, 0), (3, 1, 5), (7, 3, 5), (6, 0, 2), (6, 2, 4),
(8, 9, 6), (9, 5, 6), (10, 11, 12), (10, 13, 11), (5, 13, 10), (6, 5, 10),
(12, 11, 9), (12, 9, 8), (5, 9, 11), (13, 5, 11), (12, 8, 6), (12, 6, 10)])
import Mesh
mesh=Mesh.Mesh()
mesh.addFacets(m, False)
Mesh.show(mesh)