DInsight Home
Home Page > KernelCAD Components > Interfaces > Symmetry Interfaces
Symmetries

Symmetries (Arrays)

Symmetries are called arrays in some other CAD systems. Symmetry is property of an Object. The Symmetry property represents geometrical symmetries of the model. Using symmetries greatly increases productivity of modeling. If a section has a symmetry the object will be rendered as multiple copies of the same object placed in different location and probably with different orientation in space.

One of the main properties of symmetry is the repeat count. If for example the repeat count equals to 2 than there will be rendered two additional copies of the object. Location and orientation of the copies are determined by the type of symmetry and its parameters.

Currently there are three types of symmetries:
Axial Symmetry
Mirror Symmetry
Translation Symmetry

Common properties of symmetry include: repeat count, enable flag, visible flag and Include Children flag. If the visible flag is on, a correspondent graphic element will be drawn ( the axis in the case of an axial symmetry) to visualize properties of the symmetry. Include Children flag indicates whether the current section's children will be included in additional copies.

An object can have multiple symmetries of different types. Symmetries of a object are arranged in an array. This array can be edited in 3D Debugger by using "Current Object">Symmetries dialog. (See Symmetries Editor topic). The order of the array is important. The second symmetry is applied to the result of the first one. This means that for the second symmetry the object, which should have multiple copies, is whole set of objects generated by the first symmetry. The resulting number of copies of the original object will be equal to:

(  Repeat count of the symmetry one + 1 )  x  ( Repeat count of the symmetry two + 1 ).

Generally, changing order of symmetries leads to a different geometry of the object.

Axial Symmetry

When a object has a single axial symmetry the secondary copies of the object are created by rotation of the original (primary) one by a fixed angle, which is a parameter of the symmetry. The axis of the symmetry and angle of the rotation can be edited with 3D Debugger or accessed via IAxialSymmetry interface programmatically. Note that the axis of an axial symmetry can be any axis in 3D space. The axis is determined by a point of its origin and a non-zero direction vector.

Mirror Symmetry

Mirror symmetry adds another single copy to the primary object, which is obtained by symmetric reflection respective to a plane. The plane of the symmetry is an arbitrary plane in 3D. Its location and orientation can be defined  in 3D Debugger or by using IAxis interface, which can be queried from the correspondent ISymmetry. In this context IAxis represents normal of the plane of the symmetry. Origin of the axis is a point where the plane passes through. This point can be managed by using GetLocation and SetLocation methods of the base class ILocation of IAxis.

Translation Symmetry

Translation symmetry is defined by its translation vector. Secondary copies will be created by parallel translation of the primary object by the translation vector. To get access to the translation vector programmatically it is necessary to query ILocation interface from the correspondent ISymmetry.

Programming Symmetries

Common properties of a symmetry are managed by ISymmetry interface.  The array of symmetries of an object is managed by ISymmetries interface, which can be queried from ISection. By default the array is empty. An individual symmetry can be retrieved from ISymmetries with GetSymmetry method.

ISymmetries is a read-only interface. To add or delete a symmetry it is necessary to obtain IArray2 interface form ISymmetries and use its InsertNew or RemoveAt methods. type parameter of InsertNew must be 1, 2 or 3, for axial, mirror or translation symmetry, which are the valid values of the ESymmType enumeration.

Note that the above query ISymmetries>IArray2 is a context-dependent query. It means that between two steps ISection>ISymmetries and ISymmetries>IArray2 there must not be any other queries from the ISection interface.