OpenLexocad
28.0
|
A faceted brep is a simple form of boundary representation model in which all faces are planar and all edges are straight lines. A faceted B-rep has to meet the same topological constraints as the manifold solid Brep. (Definition from ISO/CD 16739:2011) More...
#include <FacetedBrep.h>
Public Member Functions | |
std::vector< int > | getModel () const |
void | setModel (const std::vector< int > &aValue) |
std::vector< Geom::Pnt > | getPoints () const |
void | setPoints (const std::vector< Geom::Pnt > &aValue) |
~FacetedBrep (void) | |
bool | setShape (pShape aShape) |
![]() | |
virtual | ~Geometry (void) |
pShape | computeShape (bool checkShape=false) |
pConstShape | getShape (void) const |
double | getPrecision () const |
void | setPrecision (double p) |
Geom::Bnd_Box | getBoundingBox () const |
![]() | |
std::shared_ptr< Document > | getDocument () const |
bool | isNew () const |
bool | isUpdated () const |
bool | isValid () const |
bool | hasErrors () const |
void | touch () |
LxIfc4::LxIfc4EntityEnum | getEntityType () const |
std::string | getEntityTypeAsString () const |
std::shared_ptr< Core::DbgInfo > | getDbgInfo () const |
DocObject (Core::DocObject *aObject) | |
virtual | ~DocObject (void) |
Core::DocObject * | __getObj__ () const |
Additional Inherited Members | |
![]() | |
Geometry ()=default | |
![]() | |
DocObject () | |
![]() | |
Core::DocObject * | _coreObj = nullptr |
A faceted brep is a simple form of boundary representation model in which all faces are planar and all edges are straight lines. A faceted B-rep has to meet the same topological constraints as the manifold solid Brep. (Definition from ISO/CD 16739:2011)
A faceted brep can be used to create a polyhedron. Polyhedra are 3D objects only composed by planar faces. Each face again has to be limited by straight edges. An edge is - in this case - defined as a straight line between two points (respectively, vertices).
Creating a faceted brep via this hirachical (or topological) approach is totally valid. To do so, you have to:
Another way to create a faceted brep is to use the setPoints and setModel functions.
The approach is different here.
These indices have to follow a specific format and order:
The format:
Each index refers to a point in the pointlist. A sequence of indices represents a wire. Since faces are allowed to have voids (as long as the resulting shape is still a polyhedron), one face can be made of several wires. To indicate the end of a wire, the index -2 is used. To indicate the end of a face, the index -1 is used. If your face is only constructed by a single wire, you still have to use the -2 to indicate the end of the wire, before indicating the end of the face (by a -1).
The order:
The order of the indices is used to determine, which side of it is the "outside" and which one is the "inside".
Looking at the face from the outside, the indices representing the outer boundary of the face, have to follow a counter clockwise order. To cut voids into a face, the indices of this void-wire have to follow a clockwise order (again, looking from the outside of the face onto it).
The following image shows a face with a void from the "outside". The red arrows are indicating the winding (respectively order):
The following example shows, how you can create a simple box with a side length of 10 as a faceted brep. It is created by setting a list of points and indices (as described in the second approach).
This example extends the previous one, by carving a void into the top and bottom face. Again, the winding is important here. To cut out the voids, the inner points have to be accessed in clockwise order, where the outer bounds of each face have to be accessed in counterclockwise order. To make the object still be a polyhderon, additional faces have to be added inbetween the voids. The result is a box with a squared tunnel.
OpenLxApp::FacetedBrep::~FacetedBrep | ( | void | ) |
std::vector<int> OpenLxApp::FacetedBrep::getModel | ( | ) | const |
std::vector<Geom::Pnt> OpenLxApp::FacetedBrep::getPoints | ( | ) | const |
void OpenLxApp::FacetedBrep::setModel | ( | const std::vector< int > & | aValue | ) |
void OpenLxApp::FacetedBrep::setPoints | ( | const std::vector< Geom::Pnt > & | aValue | ) |
bool OpenLxApp::FacetedBrep::setShape | ( | pShape | aShape | ) |