c++ - Create Topographic 2D Curves from Polygonal Mesh -


i'm trying convert polygonal 3d mesh series of topographic curves represent part of mesh @ specific height every interval. far, i've come idea intersect horizontal plane mesh , intersection curve(s). mesh: enter image description here

i'd intersect plane repeatedly @ set interval of precision: enter image description here

enter image description here

enter image description here

and etc.

enter image description here

while straightforward visually , in cad application, i'm lost doing programmatically. how achieve calculating in programming environment/ algorithms can achieve this?

i'm programming in stl c++ environment (with boost), loading .obj meshes this simple loader, , need simple cartesian 2d points define output curve.

an option process faces in turn , every face determine horizontal planes traverses them. given plane , face, check 4 vertexes in turn , find changes of sign (of zvertex - zplane). there 2 such changes, defining edge belongs level curve. (exceptionally can find 4 changes of sign, occurs when facet isn't planar - join points in pairs.)

every time find intersection point, tag (unique) index of plane , (unique) index of edge intersected; tag index of other edge intersected in face.

by sorting on plane index, can group intersections per plane.

for given plane, using hash table, can follow chain of intersections, edge edge.

this gives desired set of curves.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -