CADability dotNET

Modelling Data

Data model of solids and faces

There are mainly three "families" of geometric entities in CADability:

  • Curves (line, arc, circle, spline etc.)
  • Blocks (block, hatch, dimension)
  • BRep (solids, faces, edges, vertices)
BRep (boundary representation) objects are composed in a hierarchical manner
  • Vertex (e.g. the vertex of a cube)
  • Edge (e.g. the edge of a cube)
  • Face (e.g. one side of a cube)
  • Shell (e.g. all the sides of a cube)
  • Solid (a shell with no open edges)
Solid, Shell and Face are geometric entities which can reside in a model. Edge and Vertex contain geometric entities (curves and points) but also other information. Edges may have one or two parents (the Faces to which they are bounds), vertices may have any number of parents (the edges that coincide in this point). The class Make3D is a good startingpoint for creating and modifying faces, shells and solids.

What is the difference between Hatch and Face objects?

The geometric entities Face and Hatch sometimes look very similar and it may be confusing why they are used in different ways.

The purpose of the Hatch object is to enable the user to fill planar bounded regions with patterns or color. If filled by a color it looks exactely like a Face, and actually contains a face as a child object. The Hatch object is a Block object, which creates its child objects according to the HatchStyle and SimpleShape. The content may be a number of lines or other curves or a Face. A Hatch object is always planar.

The Face object is defined by a geometrical surface (e.g. a plane or a sphere) and the bounds which are the edges of the face. Faces may be planar or bend in space according to their Surface and connected with other Faces to build a shell.

How do I create a cube, sphere, cylinder or other 3D object?

Make3D is a class with many static methods to create solids.

How to combine different solids (fuse, cut, etc.)?

Make3D is a class with many static methods to combine solids. Difference, Intersection, Union provide the basic set of boolean operations.

How to make faces or solids from 2D contours?

If you have a bunch of curves (lines, arcs, circles, splines etc.) that are in a plane (not necessary the X/Y-Plane) and describe an outline or border (and maybe some holes inside that border), you can make a Face calling MakePlanarFace. The curves need not to be oriented or ordered in a certain way. You can use Extrude with that face to make a prism based on the 2D contour.