Hello
I have started implementing KCadNet in my application (design of a cutting tools like face cutter for metal), based on the Morph example, and I have several questions. The first one:
I create the section iKCSect as KernCadNet.EObjectType.eObjTypeMeshSection via the DIObjectGenerator. I do:
iKCMesh As KernCadNet.IMesh = iKCSect
iKCMeshTopol As KernCadNet.IMeshTopol = iKCSect
iKcMeshMods As KernCadNet.IMeshMods = iKCSect
I then go on populating the "KCad model" with simplexes as follows.
For Ii = 1 To NPts
' Add Vercices one by one
iKCVtx(Ii) = iKCMeshTopol(IActWin).AddVertex()
' Give coordinates to the Vertex
iKCMeshMods.SetVertexCoord(iKCVtx(Ii), VIn1(Ii), VIn2(Ii), VIn3(Ii))
Next
' Triangle 1
iKCMeshTopolAddSimplex(iKCVtx(3), iKCVtx(2), iKCVtx(1), 0#)
........
Works Ok for a beginning. Issues:
A tooth uses ~ 2100 simplexes; thus the cutter (11 teeth) uses ~ 22440 simplexes, The tool comes out Ok, but some parts are missing
What is wrong in my approach?
I would appreciate any suggestions
Thank you
Missing parts of the surface
Re: Missing parts of the surface
Hi CG
Things to check:
1. Do they appear if you look from the opposite side? If yes, the orientation you have defined for the simplexes is wrong. Vertices must be in CCW order looking from outside
2. Check for simplexes degenerated into a segment or a point (all vertices on a same line or all coincide). This would be reported by IMesh.IsValid()
3. If some vertices have by some reason too large coordinates they would be simply out of screen. Try zooming out hard.
Try playing with the definition of the mesh. Reduce it to a nice single simplex
add one which is missing or set of them, Play with coordinates, etc.
Nick
Things to check:
1. Do they appear if you look from the opposite side? If yes, the orientation you have defined for the simplexes is wrong. Vertices must be in CCW order looking from outside
2. Check for simplexes degenerated into a segment or a point (all vertices on a same line or all coincide). This would be reported by IMesh.IsValid()
3. If some vertices have by some reason too large coordinates they would be simply out of screen. Try zooming out hard.
Try playing with the definition of the mesh. Reduce it to a nice single simplex

Nick
Re: Missing parts of the surface
CG,
also putting the last parameter zero in
iKCMeshTopolAddSimplex(iKCVtx(3), iKCVtx(2), iKCVtx(1), 0#)
is not good. It is the crease angle. It should be something like 30 (degrees) or greater. If your surface is not flat it will look faceted
Cheers
also putting the last parameter zero in
iKCMeshTopolAddSimplex(iKCVtx(3), iKCVtx(2), iKCVtx(1), 0#)
is not good. It is the crease angle. It should be something like 30 (degrees) or greater. If your surface is not flat it will look faceted
Cheers
Re: Missing parts of the surface
Thank you, Nick
This crease angle is little unclear. Can you expand a bit?
Regards
This crease angle is little unclear. Can you expand a bit?
Regards