OpenLexocad  27.1
OpenLxApp::AdvancedBrep Class Reference

An advanced B-rep is a boundary representation model in which all faces, edges and vertices are explicitly represented. It is a solid with explicit topology and elementary or free-form geometry. The faces of the B-rep are of type IfcAdvancedFace. An advanced B-rep has to meet the same topological constraints as the manifold solid B-rep. (Definition from ISO/CD 16739:2011) More...

#include <AdvancedBrep.h>

Inheritance diagram for OpenLxApp::AdvancedBrep:
OpenLxApp::Geometry OpenLxApp::DocObject

Public Member Functions

 ~AdvancedBrep (void)
 
bool setShape (pShape aShape)
 
- Public Member Functions inherited from OpenLxApp::Geometry
virtual ~Geometry (void)
 
pShape computeShape (bool checkShape=false)
 
pConstShape getShape (void) const
 
double getPrecision () const
 
void setPrecision (double p)
 
Geom::Bnd_Box getBoundingBox () const
 
- Public Member Functions inherited from OpenLxApp::DocObject
std::shared_ptr< DocumentgetDocument () 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::DbgInfogetDbgInfo () const
 
 DocObject (Core::DocObject *aObject)
 
virtual ~DocObject (void)
 
Core::DocObject__getObj__ () const
 

Additional Inherited Members

- Protected Member Functions inherited from OpenLxApp::Geometry
 Geometry ()=default
 
- Protected Member Functions inherited from OpenLxApp::DocObject
 DocObject ()
 
- Protected Attributes inherited from OpenLxApp::DocObject
Core::DocObject_coreObj = nullptr
 

Detailed Description

An advanced B-rep is a boundary representation model in which all faces, edges and vertices are explicitly represented. It is a solid with explicit topology and elementary or free-form geometry. The faces of the B-rep are of type IfcAdvancedFace. An advanced B-rep has to meet the same topological constraints as the manifold solid B-rep. (Definition from ISO/CD 16739:2011)

Introduction

An AdvancedBrep is the generalized form of a FacetedBrep. Where the FacetedBrep has to be a polyhedron - in a mathematical sense - the AdvancedBrep "only" has to be a manifold. This means, it still has to be a closed body, but its faces and edges don't have to be planar or straight anymore.

In contrast to the FacetedBrep, you can't define an AdvancedBrep via setPoints() and setModel methods. To create an AdvancedBrep, you have to define its faces and merge them into a shape, which then forms the AdvancedBrep via the setShape method (similar to the first approach described in FacetedBrep).

Example

The following example will create a cylinder by creating each of the outer faces separately and then merging them into an advanced brep.

import OpenLxApp as lx
import Geom, Base, Topo
import math
app = lx.Application.getInstance()
doc = app.getActiveDocument()
# Create a base circle with radius 3.
ax2 = Geom.Ax2()
circle = Geom.Circ(ax2, 3)
# Create a list for 3 faces.
faceList = Topo.vector_Face(3)
# Create the bottom face by "cutting" a 360° (2pi in radians) arc of a circle.
bottomFaceEdge = Topo.EdgeTool.makeArcOfCircle(circle, 0, 2 * math.pi)
# Make a wire of the created circle-edge.
bottomFaceWire = Topo.WireTool.makeWire(bottomFaceEdge)
# Form a face of the wire.
bottomFace = Topo.FaceTool.makeFace(bottomFaceWire)
# Add it to the face list.
faceList[0] = bottomFace
# Create the outer face by cutting a 360° arc of a circle and extrude it.
outerFace = Topo.FaceTool.makeCylindricalFace(circle, 0, 2 * math.pi, 7)
# Add it to the face list.
faceList[1] = outerFace
# Shift the circlecenter by 7, to create the top face.
circle.setLocation(Geom.Pnt(0, 0, 7))
# Again, cut out a 360° arc of a circle.
topFaceEdge = Topo.EdgeTool.makeArcOfCircle(circle, 0, 2 * math.pi)
# Make it a wire.
topFaceWire = Topo.WireTool.makeWire(topFaceEdge)
# Create a face of the wire.
topFace = Topo.FaceTool.makeFace(topFaceWire)
# Add it to the face list.
faceList[2] = topFace
# Form a shape of the faces in the list.
shape = Topo.ShapeTool.makeShape(faceList)
# Create an advanced brep and define it via setShape.
advancedBrep = lx.AdvancedBrep.createIn(doc)
advancedBrep.setShape(shape)
# To draw the advanced brep, assign it to an Element and recompute the current document.
abElement = lx.Element.createIn(doc)
abElement.setDiffuseColor(Base.Color(32,192,0,255))
abElement.setGeometry(advancedBrep)
doc.recompute()
The result:
AdvancedBrep.png
An AdvancedBrep.
See also
Documentation from IFC4: IfcAdvancedBrep

Constructor & Destructor Documentation

◆ ~AdvancedBrep()

OpenLxApp::AdvancedBrep::~AdvancedBrep ( void  )

Member Function Documentation

◆ setShape()

bool OpenLxApp::AdvancedBrep::setShape ( pShape  aShape)

The documentation for this class was generated from the following file: