Missing parts of the surface

Technical discussions
Post Reply
CG_
Posts: 6
Joined: Fri Mar 03, 2017 12:25 am

Missing parts of the surface

Post by CG_ »

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

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Missing parts of the surface

Post by nickz »

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

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Missing parts of the surface

Post by nickz »

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

CG_
Posts: 6
Joined: Fri Mar 03, 2017 12:25 am

Re: Missing parts of the surface

Post by CG_ »

Thank you, Nick
This crease angle is little unclear. Can you expand a bit?
Regards

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Missing parts of the surface

Post by nickz »

CG, I have posted the answer here:
http://www.dynoinsight.com/phpBB3/viewt ... f=2&t=3024
Cheers

Post Reply