Click here to Skip to main content
15,904,339 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Does anyone know about a C++ implementation of a convex body that supports clipping with planes, adding points and (optionally) extruding to a given plane ?
Posted

sixio wrote:
Does anyone know about a C++ implementation of a convex body that supports clipping with planes, adding points and (optionally) extruding to a given plane ?


Maybe, if you kindly explain what is "a C++ implementation of a convex body".
:)
 
Share this answer
 
Sorry for not being clear. I'm looking for a C++ library that has a class, or a set of classes, representing a generic convex polyhedron, with the following minimal capabilities:
- "manual" construction adding points / faces / edges;
- Clip() function taking a plane;
Thank you for you help.
 
Share this answer
 
Clipping a 3D convex polyhedra against a plane is simple. All you have to do is clip each line against the place. This will give you the new point in the clipping place. From them you can construct the polygon in the clipping plane. See <a href="http://www.cubic.org/docs/3dclip.htm">http://www.cubic.org/docs/3dclip.htm</a>[<a href="http://www.cubic.org/docs/3dclip.htm" target="_blank" title="New Window">^</a>].

For adding new points, lines, or polygon. I think you need to define problem more clearly. How does a new point connect to the polyhedra? Does the new polygon has to be convex as well? Intuitively I think this is not always possible.

-Saurabh
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900