Skip to main content

BrepGeometry

The BrepGeometry class represents the geometric structure of a 3D brep, including its faces and materials. It allows for defining and manipulating the geometry hierarchical relationships, such as setting parent-child relationships between geometries, with support for two parent geometries to create seamless Level of Detail (LOD) transitions.

#include <format/TellusimBrep.h>

Constructors

explicit BrepGeometry(const char *name = nullptr)
explicit BrepGeometry(Brep &brep, const char *name = nullptr)

Methods

Clear geometry.

void clear()

Geometry name.

void setName(const char *name)
String getName() const

Geometry index.

uint32_t getIndex() const

Geometry brep.

void setBrep(Brep &brep, bool check = true)
const Brep getBrep() const
Brep getBrep()

Geometry parent.

uint32_t setParent0(BrepGeometry &parent, bool check = true)
uint32_t setParent1(BrepGeometry &parent, bool check = true)
const BrepGeometry getParent0() const
const BrepGeometry getParent1() const
BrepGeometry getParent0()
BrepGeometry getParent1()
bool isRoot() const

Geometry children.

void reserveChildren(uint32_t num_children)
uint32_t addChild0(BrepGeometry &child, bool check = true)
uint32_t addChild1(BrepGeometry &child, bool check = true)
bool removeChild(BrepGeometry &child)
void releaseChildren()
uint32_t findChild(const BrepGeometry &child) const
uint32_t getNumChildren() const
const Array<BrepGeometry> getChildren() const
Array<BrepGeometry> getChildren()
const BrepGeometry getChild(uint32_t index) const
BrepGeometry getChild(uint32_t index)

Geometry winding.

void setWinding(float64_t winding)
float64_t getWinding() const

Geometry faces.

void clearFaces()
void reserveFaces(uint32_t num_faces)
uint32_t addFace(BrepFace &face)
bool removeFace(BrepFace &face)
bool replaceFace(BrepFace &old_face, BrepFace &face)
uint32_t findFace(const BrepFace &face) const
uint32_t getNumFaces() const
const Array<BrepFace> getFaces() const
Array<BrepFace> getFaces()
const BrepFace getFace(uint32_t index) const
BrepFace getFace(uint32_t index)

Geometry materials.

void clearMaterials()
void reserveMaterials(uint32_t num_materials)
uint32_t addMaterial(BrepMaterial &material, bool check = true)
bool removeMaterial(BrepMaterial &material)
bool replaceMaterial(BrepMaterial &old_material, BrepMaterial &material)
uint32_t findMaterial(const BrepMaterial &material) const
uint32_t findMaterial(const char *name) const
uint32_t getNumMaterials() const
const Array<BrepMaterial> getMaterials() const
Array<BrepMaterial> getMaterials()
const BrepMaterial getMaterial(uint32_t index) const
BrepMaterial getMaterial(uint32_t index)

Geometry bound box.

void setBoundBox(BoundBoxd box)
const BoundBoxd getBoundBox() const

Geometry bound sphere.

void setBoundSphere(BoundSphered sphere)
const BoundSphered getBoundSphere() const

Geometry transform.

void setTransform(float64_t scale)
void setTransform(Matrix4x3d transform)
const Matrix4x3d getTransform() const

Visibility range.

void setMinVisibility(float32_t distance)
void setMaxVisibility(float32_t distance)
void setVisibilityRange(float32_t min, float32_t max)
float32_t getMinVisibility() const
float32_t getMaxVisibility() const
bool hasVisibilityRange() const

Visibility error.

void setVisibilityError(float32_t error)
float32_t getVisibilityError() const

Create bounds.

bool createBounds(bool force = false)

Optimize materials remove duplicates.

void optimizeMaterials()

Compare geometries.

int32_t compare(const BrepGeometry &geometry, Matrix4x3d transform = Matrix4x3d::identity, float64_t threshold = 1e-6, bool spatial = true) const

Memory usage.

size_t getMemory() const