Teigha Blog

Find out what's new and more

Two Ways to Work with Teigha BIM B-Reps

Many elements in Teigha BIM contain B-Rep geometries in GElement, which is a geometry cache of an element. However, B-Rep is not a universal format. Each product has a specific representation of B-Reps.

An overview of B-Reps and BIM specifics can be found in the documentation (login required).

rvt rfa Example

Creating ACIS Nurbs Surfaces using B-Rep Builder

With Teigha you can create ACIS nurbs surfaces using a B-Rep Builder interface. Currently Teigha has two B-Rep Builder implementations: one in Teigha Kernel named AcisBrepBuilder and the other in Teigha BIM named BmBrepBuilder.

Example b-rep

Teigha BIM: Introduction to FillPatterns [Part 2]

FillPattern rendering is performed when rendering a corresponding shell if the OdGiFill traits attribute is supplied. As described in a previous article, OdGiFill is supplied by an OdBmFillPatternElem::subSetAttributes(OdGiDrawableTraits* pDrwTraits) call if an existing OdBmFace->OdBmGFilling->PatternId is present. OdGiFill represents the hatch data needed for a FillPattern to be rendered, which is not enough. To render the pattern correctly, OdGiFaceData and OdGiMapperItemEntry are also required.

rvt rfa Example

Attaching windows to walls

In Teigha Architecture, objects can be attached to other objects. Such connections are handled by special anchor objects which are stored in a .dwg file just like any other object. An anchor is represented by the base class AECDbAnchor. The meaning of the connection between objects can be different: for example, windows are inserted in a wall, or a schedule table is attached to an object.

Architecture Example

Teigha BIM: Introduction to FillPatterns [Part 1]

OdBmFillPatternElem is bound to a face via OdBmFace->OdBmGFilling->PatternId. So while traversing faces in BrepRenderer, for every face we obtain an OdBmFillPatternElem ID via IBrFace->getFillPatternId(). See the code below:

rvt rfa Example

Finding openings attached to a wall

In Teigha Architecture, objects can be attached to other objects. Such connections are handled by special anchor objects which are stored in a .dwg file just like any other object.

Architecture Example

Using Incremental Saving for .dwg Files

When working with large .dwg files, sometimes a full save can be slow. Teigha has a new incremental file saving feature for .dwg files that saves only modified data, which is faster than a full save for large files that don’t contain a lot of modifications.

Teigha provides two methods to perform the incremental file save:

performance Example

Visual Basic Developers Use Teigha

Thanks to Teigha.NET, C++ developers are not the only CAD developers using Teigha. And C# is not the only language that can be used to design a Teigha.NET based application. Visual Basic can be used as well.

Earlier versions of Teigha included only C# sample applications in the Teigha.NET archive, but now a Visual Basic sample application is included: VBDwgAppSwigMgd.

.NET Example getting started

Working with raster image wrappers

Raster image wrappers provide a way to modify raster image data without modifying the original raster image. Each raster image wrapper stores a smart pointer to the original image and can get any data from the original image and return it with or without modifications. Actually, by using raster image wrappers we can construct a conveyor for multi-pass image processing.

Raster image Example

Planar clipping sections generation for custom entities

Teigha vectorization framework provides ability to clip geometry inside rendered scene, using OdGiOrthoClipperEx conveyor node which is always available inside default geometry vectorization conveyor.

rendering Example