Register | Log in

Samples

Source code samples

The following sample projects are located under the Documents folder of your machine. You'll find for each one both C# and VB.NET source code for both WinForms and WPF platforms.

AdvancedPrinting

This sample explains how to vector-print your model on paper and on file (in *.emf format). The resulting report contains two views, the primary one with the current model orientation while the secondary one with a programmatically set point of view.

Arrows

This sample explains how to draw vector fields using the Mesh.CreateArrow() static method and the Transformation class for object rotation.

Assembly

This sample explains how to assemble individual objects. You can chose between direct, transformation and animation methods.

AssemblyBrowser

This sample explains how to navigate an assembly tree bidirectionally. When selecting components you can chose between Branch and Leaf methods.

Barbecue

This sample explains how to draw a barbecue 3D model using Solid entity and boolean operations.

BlendSurface

This sample explains how build a blend surface between two surface edges. You can change the influence of each edge interactively.

Building

This sample explains how to use Block and BlockReference to draw a 3D building model. It also demonstrates how to use the Attribute entity.

CopyAndPaste

This sample explains how to copy and paste entities between two independent ViewportLayout controls and how to keep their views in sync. In WinForms, it also contains the logic for resizeable SplitContainer implementation.

CustomData

This sample explains how to add custom data to an entity and how to retrieve it at runtime. This can be easily accomplished using the Entity.EntityData property.

CustomReadWrite

This sample explains how to implement your own file format (in this case XML) to save and restore your geometry.

CustomToolbar

This sample explains how to add custom buttons to the Viewport toolbar. It also demonstrates the ability to change the coordinate system icon with a custom list of Mesh objects. Not all applications require world axes, for example in medical applications a torso shape is preferred.

CustomViewportLayout

This sample explains how to create your custom viewport layout. In this case with two viewports vertically stacked.

Delaunay

This sample explains how to use the Delaunay triangulation. You can use it with points or loops or both. Outer loop must be closed (first and last points must have the same coordinates) while internal loops can be closed or not. For closed loops, orientation must be counterclockwise for outer and clockwise for inner ones.

DraftAnalysis

This sample explains how to split a Mesh entity according to a pull direction and how to animate BlockReferences using a standard trackbar.

DraftingDemo

This sample explains how to implement interactive drawing of 2D curves and dimensions. It can be considered a good starting point to create a 2D CAD system.

DragControlPoint

This sample explains how to interactively drag a Nurbs surface control point. The trick is to drag a standard point and update the desired surface control point. Nurbs surfaces need to be regenerated after this operation, therefore the RegenMode property is set accordingly.

EyeshotDemo

A fully featured application that demonstrates what you can do with the ViewportLayout control.

FeatureDetection

This sample explains how to detect features of a specific type on a 3D model. The filters allow to narrow down the number of cylinders or cones detected and the Show axes button to show cylinders axis.

FemDemo

This sample demonstrate Eyeshot Finite Element Analysis capabilities, including mapped meshing and 2D and 3D beams with hinge support. The Numeric results button opens a dialog containing all the results in a tabular view.

FirstPerson

This sample explains how to change the viewport navigation method using the Viewport.Navigation.Mode property. It also includes an advanced implementation of multi-texturing.

FunctionPlot

This sample explains how to draw a Mesh entity with a different color on each vertex.

Globe

This sample explains how to draw a globe model using the Mesh.CreateSphere() static method. It also uses of Mesh.ApplyMaterial() method to map the material texture spherically.

Gym

This sample explains how to draw a gym frame using Nurbs surfaces.

HiddenViewport

This sample explains how to work with a hidden ViewportLayout control. In some cases you may want to produce drawings or images without displaying the geometry the Form/Window.

HybridEntity

This sample explains how to change entity nature on the fly. In this case the beams drawing is switched between Mesh and wires.

Kinect

This sample explains how to use the Microsoft® Kinect sensor as input device. This Visual Studio project requires the Microsoft® Kinect for Windows Runtime v1.8.

Layers

This sample explains how to work with layers. It also includes the code to use a ImageOnly label and tooltips support: hovering an entity, the entity index is displayed.

Lego

This sample explains how to do modeling in background while keeping the user interface responsive. In addition it demonstrates how to hide built-in progress bar and use a standard progress bar and Cancel button.

LineTypes

This sample explains how to use line types for curve entities, different line type are defined and used. It also includes the usage of Joint and Bar entities.

MachineSimulator

This sample explains how to simulate a 3 axis CNC machine movements. First the moving parts are loaded from STL files and added to three different Block definitions, then three subclassed BlockReferences override the Animate() and MoveTo() methods respectively, to compute new position and to move the objects (on GPU only).

MarchingCubes

This sample explains how to draw the isosurface of a 3D scalar field. The resulting surface is a Mesh entity.

MoveByMouse

This sample explains how to move entities with the mouse.

MVVM

This sample explains how to use WPF data binding.

ObjectManipulator

This sample explains how to set a BlockReference current and how to modify interactively its position/orientation with the ObjectManipulator widget.

Part1

This sample explains how create and merge individual Mesh entities. Volume calculation is also implemented.

PenLike

This sample demonstrates how to draw on the ViewportLayout control with a pen.

PipeBending

This sample explains how to simulate a pipe bending machine to reproduce the pipe shape. Bending axes are also computed and drawn.

PistonAnimation

This sample explains how to animate a group of entities.

ProductConfigurator

This sample explains how to draw a parametric 3D chair model using Mesh entity. It rebuilds the model interactively while changing material, size, etc. The resulting geometry can be exported in STL file format.

ReadDWG

This sample explains how to load DWG/DXF® files directly and asynchronously. This is the only scenario where the application needs to be compiled against x86 or x64, see Geometry Import/Export topic in the product documentation.

Routing

This sample explains how to draw and give shape to an electrical wire or flexible pipe. You can add multiple joints and move them using the right mouse button.

RubberBandCurve

This sample explains how to draw and edit interactively a Nurbs curve.

RubberBandLine

This sample explains how to draw interactively a LinearPath entity.

Ruler

This sample explains how to draw an interactive ruler on the Viewport surface. The ruler drawing changes tick density based on current zoom factor. This sample also demonstrates how to display a logo in overlay on the 3D scene.

SceneEditor

This sample gives you full control on the scene lighting settings. On the left pane you see the camera view while on the right one, the 3D scene from the director point of view. You can turn on up to eight lights of point, spot, directional and stationary types and change each light settings. Currently only one light can yield shadow.

SelectPoints

This sample explains how to implement a custom selection method on a FastPointCloud entity. The Undo and Unselect commands are also provided.

SelectTriangles

This sample explains how to implement individual Mesh triangles selection.

SnapToGrid

This sample demonstrates how to snap on grid lines while drawing.

SurfaceSection

This sample explains how to generate a section of a 3D surface model.

TextOnCurve

This sample explains how to arrange a text on a freeform curve.

TextureMapping

This sample explains how to apply different texture mappings to scene objects. You can experiment each mapping and scaling combination simply dragging the desired material on the scene object. Additionally, it demonstrates how to create realistic materials.

Transformation

This sample explains how to place planar entities on planes different from XY.

volumerendering

This sample demonstrate Eyeshot DICOM capabilities, including surface reconstruction, sectioning, measurement and STL output for 3D printing.