BREP API – A Very Basic Primer (AutoCAD .net API)

Posted on Posted in Autocad .Net API
A very nice mesh surface of a face.
A very nice mesh surface of a face.


The boffins at AutoDesk have ported that which has existed in the ObjectARX API into .net – it’s basically a wrapper. And on a side-note – it is well worth reading the ObjectARX documentation for that very reason – let’s face it – the documentation for AutoCAD APIs are not very good. So definitely read the ObjectARX API.

Here are some very useful resources that you will need in order to fully utilise this API:

What is the BRep API all about?

  • Think of Breps as a novel way of representing shapes in a hierarchical way. This won’t make much sense to you – but consider the example below: re: traversal of this hierarchy.

What is it useful for?

Brep API is useful for: (i) traversing a hierarchy of shapes, (ii) Point Containment calculations and (iii) Meshing.

(A) Traversing a hierarchy of shapes.

Ok. When you think of a cube for example, you have a 3d object:

  • Cube (the cube can also be thought of as a shell – a set of connected faces).That cube is made up of 6 faces, all of which are squares.
    • Those faces are made up of 4 edges each.
      • Those edges are bade up of 2 vertexes bounded by a curve.

All 3d objects can be broken down somewhat into a hierarchy of simpler objects. The BREP API allows you to traverse that hierarchy and make queries according to your particular requirements/needs/application.

(B) Containment calculations

Let’s suppose you have a sphere and you want to determine whether a point lies within the sphere or outside of it. You could use the Brep API to make this determination.

(C) Drawing meshes to represent surfaces

You could use the API to create meshes which can approximate a 3d surface or object.

Leave a Reply

Your email address will not be published. Required fields are marked *