The control shows three-dimensional geometry through the view direction, the Rendering property and the entities in the drawing. The same methods that set the view also apply to geometry created in code and to geometry read from a file.

Predefined views

DisplayPredefinedView

DisplayPredefinedView sets the view direction of the active viewport. The figures below use RenderingType.ShadedEdges.

Front view

Front — PredefinedViewType.Front, looking along −Y.

Right view

Right — PredefinedViewType.Right, looking along +X.

Top view

Top — PredefinedViewType.Top, looking along the Z axis.

North-east isometric view

NE Isometric — PredefinedViewType.NE_Isometric.

PredefinedViewTypeView direction
Top Z axis
Bottom −Z
Left −X
Right +X
Front −Y
Back +Y
SW_Isometric, SE_Isometric, NE_Isometric, NW_Isometric the four isometric directions

A named view stored in the drawing is recalled with DisplayView. ZoomCenter frames the geometry in the current view.

dxfReaderNETControl1.DisplayPredefinedView(PredefinedViewType.NE_Isometric);
dxfReaderNETControl1.ZoomCenter();

Orbit

Orbit

Orbit rotates the current view about its target. Pass the current pointer position as StartPoint and the position where the drag began as TargetPoint. Both points use one coordinate system, with Y increasing upward. A drag across the control rotates the view by half a turn, and the rotation does not stop at the vertical poles.

dxfReaderNETControl1.Orbit(currentPoint, anchorPoint);

Rendering

Rendering

The Rendering property selects how faces and edges are drawn. The figures below are all in the SW isometric view. Light is in view space, from the upper left toward the observer. 3D faces are lit on one side. Meshes are lit on both sides, so they stay visible when the vertex order is mixed.

Wireframe rendering

Wireframe — RenderingType.WireFrame. Edges only. Hidden faces stay visible. This is the default.

Shaded rendering

Shaded — RenderingType.Shaded. Filled faces, depth-sorted and lit.

Shaded edges rendering

Shaded edges — RenderingType.ShadedEdges. Filled faces with their edges drawn on top.

Hidden-line rendering

Hidden — RenderingType.Hidden. Visible edges only. The rest is covered by the background.

Glazed surfaces stay semi-transparent and leave the geometry behind them visible. Frames stay opaque.

dxfReaderNETControl1.Rendering = RenderingType.ShadedEdges;

3D entities

Creating and reading solid geometry

DXF and DWG entities are drawn with the current view and rendering mode. The same entities can be added to the drawing from code.

EntityHow to add it
Face 3D AddFace3D — four vertices of one face
Solid AddSolid — three or four vertices
Helix AddHelix — axis, start point, radius and number of turns
3D polyline AddPolyline with vertices that carry a Z coordinate
Polyface mesh read from the DXF as a PolyfaceMesh
Mesh read from the DXF, or produced by ReadIFC (one mesh per product)
3D solid (ACIS) read from the DXF as a Solid3D. The proprietary body data is available in the drawing information
dxfReaderNETControl1.AddFace3D(first, second, third, fourth);
dxfReaderNETControl1.AddHelix(axisBase, startPoint, radius, turns);
dxfReaderNETControl1.Rendering = RenderingType.ShadedEdges;
dxfReaderNETControl1.DisplayPredefinedView(PredefinedViewType.SW_Isometric);

Import

ReadSTEP, ReadOBJ and ReadIFC

These methods replace the current drawing with the geometry of the file, then display it with the active view and rendering mode.

STEP model shown as wireframe

STEP — ReadSTEP reads AP214 and AP203 edge curves as wireframe entities: lines, circles and 3D polylines, grouped by part name. CircleSegments is the number of segments used for arcs (minimum 8, default 36).

IFC model shown with shaded edges

IFC — ReadIFC tessellates extruded solids, profiles, mapped items, faceted BREP and face sets into one Mesh per product. Layers follow the IFC class. Groups follow the building storeys. TessellationQuality is the number of segments on curves (minimum 8, default 16). When DisplayAfterRead is true and the current mode is wireframe, the control switches to ShadedEdges and sets a south-east isometric view.

OBJ — ReadOBJ reads the vertices and faces of a Wavefront file.

dxfReaderNETControl1.ReadSTEP(@"C:\models\part.stp");
dxfReaderNETControl1.ReadOBJ(@"C:\models\mesh.obj");
dxfReaderNETControl1.Rendering = RenderingType.ShadedEdges;
dxfReaderNETControl1.ReadIFC(@"C:\models\building.ifc");

Printing and export

PlotRendering and Image

PlotRendering decides how the colors of the current view reach the paper when Plot is called.

  • PlotRenderingType.Color — the shaded colors are printed.
  • PlotRenderingType.GrayScale — each color becomes the matching gray.
  • PlotRenderingType.Monochrome — black and white only. This is the default.

The Image property is the bitmap of the view currently drawn in the control.

dxfReaderNETControl1.Rendering = RenderingType.ShadedEdges;
dxfReaderNETControl1.PlotRendering = PlotRenderingType.Color;
dxfReaderNETControl1.Plot();

Editing the geometry

NormalizeEntities and FlattenEntities

NormalizeEntities moves entities whose normal is not Z onto the XY plane, along that normal. FlattenEntities sets Z to zero on lines, points, circles, ellipses, text, polylines, arcs and splines.