Wed, 04/17/2024 - 17:27
Forums:
So CAD Assistant has 5 levels of detailing to perform Meshing: ["Very Rough", "Rough", "Normal", "High", "Very High"]
Can we know which are the "Normal" exact parameters being used to set BRepMesh_IncrementalMesh? (deflection, deflection interior, angle, angle interior, minSize, etc.)
If confidential, please share the ones being used inside Draw Harness.
Thanks.
Thu, 04/18/2024 - 12:18
Hello, that is not a secret and you are free to find that info in logs.
Enabling logs:
Log:Best regards, Dmitrii
Thu, 04/18/2024 - 16:02
Thank you so much for this insight!
I've recreated it like this:
meshParams.MeshAlgo = IMeshTools_MeshAlgoType::IMeshTools_MeshAlgoType_DEFAULT;
meshParams.Angle = 0.34906585;
meshParams.Deflection = 0.001;
meshParams.MinSize = 0.1;
meshParams.InParallel = 1;
meshParams.InternalVerticesMode = 1;
meshParams.ControlSurfaceDeflection = 1;
auto mesher = BRepMesh_IncrementalMesh(face, meshParams);
But with those parameters I get 67,243 triangles , and in CAD Assistant it gets 10,286 triangles, so its way more optimized somehow.
Sun, 04/21/2024 - 06:49
You set
Deflection=0.001
, while CAD Assistant uses Deflection close to0.1
. The 'rel' means 'relative' calculated from bounding box (the explanation from here might help) using math likeStdPrs_ToolTriangulatedShape::GetDeflection()
.Mon, 04/22/2024 - 18:37
So I used your personal blogspot commands with a specific brep face (0:1:1:1:1) of the initial .iges file that I shared . It is also attatched as outputBFace.brep
Also isn't there any commands to perform meshing this quick but with the whole .iges file directly, instead of only a face?
But still pretty ugly triangularization I think, isn't it? (LOOK AT THE IMAGE ATTATCHED)
Tue, 04/23/2024 - 00:39
In your incmesh command you used deflection 100, which is quite large value I think to get a good triangulation.
Tue, 04/23/2024 - 08:39
You haven't shared your script. I guess you have read IGES file into XCAF document via
ReadIges
command. In this case you may useXGetOneShape
command to get entire document as a shape:Tue, 04/30/2024 - 14:51
So, indeed the holy grail was to do meshing with all faces in a compound, instead of meshing faces one by one....
Now the other question is how do I use "ComputeNormals()"? I mean I have all the triangularizations done, and topology is good, but my model looks like "flat shading" after I generate a .obj out of it... It doesn't look like "averaged normals" or "surface normals" like here:
https://unlimited3d.wordpress.com/2024/03/17/brepmesh-intro/
Thu, 05/02/2024 - 11:16
Something like this?
Thu, 05/02/2024 - 15:26
Thank you very much. With everything I discovered here I finally have it perfectly.
Key takeaways:
- use relative/absolute deflections based from bounding box of compound.
- use compound (instead of meshing by individual face shapes)
- use smooth normals from brep (instead of averaging mesh face normals)
How can this simple API call tweak be so different.....
triangulation->ComputeNormals(); // BAD
BRepLib_ToolTriangulatedShape::ComputeNormals(face, triangulation); // GOOD
Tue, 04/23/2024 - 00:34
Did you use the command "vdefaults -autoTriang 0" before displaying? If you didn't then the command "vdisplay" can ignore the available triangulation and build a new one.