
Mon, 08/14/2017 - 02:53
Forums:
Hi! I need collection of 3d lines of shape edges, how i can get it?
I have TopoDS_Shape, i know, how to iterate all faces, so i have TopoDS_Face -s, and now i want to take edges of each face for rendering it with custom 3d engine. I need simple collection of 3d lines, like this: LINE1(v1,v2), LINE2(v1,v2) and so on...
need help :(
Mon, 08/14/2017 - 11:00
Guys, ok. I don't need edges of single face :-) I need all edges of the shape,for example, box have 10 edges. How i can to retrieve this edges of my shape?
Mon, 08/14/2017 - 11:23
Hello,
Please look at "TopExp_Explorer" class. It allows to iterate over sub-shapes.
qa qa
Mon, 08/14/2017 - 11:40
Thank you very much for reply! But sorry, i'm really newbie in OCC, can you show me few lines of C++ code to get edges of...for example, simple box shape? I need collection of 3d lines with start and end vertices for each line to drawing native in OpenGl as lines...
P.S.: at now i really don't understand, how OCC topology works, handlers...strange class names, strange FOR itarators...:-)
Thanks
Mon, 08/14/2017 - 11:47
Hello! You can search "TopExp_Explorer" in your OCC samples (just like "Geometry" or "Modeling" which is in "All-vc-10").And you can solve many problems in this way !Just try "ctrl+F"
Mon, 08/14/2017 - 11:50
Hello,
Here is my short sample:
qa qa
Mon, 08/14/2017 - 12:20
Thank you! you are my idol! :-)
Hmm.. If my edges is a simple segments (simple box shape), it's mean, that here i need only 2 points? Can i iterate over segment edges or in any case, i need first iterate over curves and after transform it into the line segment?
Mon, 08/14/2017 - 12:48
Well, when your underlying curves are represented by lines, this snippet can be significantly simplified - you can you use TopExp::Vertices(...) instead of discretization procedure. Here is updated sample:
qa qa
Mon, 08/14/2017 - 14:28
Wow! Many thanks, bro!