DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Collapse ModelsModels
Models
Persistence
Model Properties
Collapse EntitiesEntities
Collapse GeometryGeometry
Geometry
Collapse BRepBRep
BRep Overview
BRep Geometry
Shapes
Curves
Surfaces
Faces
Wires
Edges
Compounds
Collapse MeshMesh
Mesh Geometry
Mesh
BRep to Mesh Conversion
Curve Geometry
Line Strips
Point Sets
Overlays
Collapse AttributesAttributes
Local Frame
Appearance
Texture
Properties of an Entity
Collapse Model ItemsModel Items
Items
3D Text
Smart Labels
View Points
Collapse MeasurementsMeasurements
Measurements
Persistent Measurements
Grid
Collapse Operations and AlgorithmsOperations and Algorithms
Boolean Operations
Euclidean Shortest Path
Collapse MovementMovement
Movements
Kinematic Entities
Collision Detection
Collapse Import/ExportImport/Export
Import/Export Overview
Data Flow Sample
STL Tree
Collapse DG Kernel ControlsDG Kernel Controls
Components
DG Kernel Control
Collapse Properies, Methods, EventsProperies, Methods, Events
Properies
Methods
Events
Collapse Interactive FunctionalityInteractive Functionality
View
Context Menu
Measurements
Direct User Access
Modes of DG Kernel
Current Entities
Collapse Selection OverviewSelection Overview
Selection
Selection Event
Collapse Auxiliary ViewsAuxiliary Views
Model Explorer
Birds Eye View
Full Screen window
Collapse Programmatic FunctionalityProgrammatic Functionality
Programming
Queries
Data Types
Object Construction
Generator
Component Context
Initialisation Context
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
IPointArray_DG
IPointMatrix_DG
IPointCloud_DG
Collapse CurvesCurves
ICurve_DG
ILine_DG
ICircle_DG
IEllipse_DG
IBSplineCurve_DG
IBSplineCurveInterpolator_DG
ICurveFreeForm_DG
IArcSpline3DCurve_DG
Collapse 2D2D
ICurve2d_DG
IBSplineCurve2d_DG
ICircle2d_DG
ILine2d_DG
IArc_DG
Collapse SurfacesSurfaces
IUVSurface_DG
IPartialSplineProps_DG
IBSplineSurface_DG
IBezierSurface_DG
IPartialBezierProps_DG
IRectangularTrimmedSurface_DG
ISurfaceOfRevolution_DG
Collapse Oriented ObjectsOriented Objects
IObjectOriented_DG
IPlane_DG
ISphere_DG
ICylinder_DG
ICone_DG
ITorus_DG
IBox_DG
IPolygon3D_DG
IGeometricObject_DG
Collapse GeneralGeneral
IElement_DG
IStrip_DG
Collapse ModelModel
IModel_DG
Collapse EntitiesEntities
IEntity_DG
IEntityArray_DG
IStdShape_DG
IStdShapeRef_DG
IDraw_DG
IEntity2d_DG
IModel2d_DG
Collapse GeometryGeometry
IGeometry_DG
IPointSetGeometry_DG
ISegmentStripGeometry_DG
ICurveGeometry_DG
ISurfacePoint_DG
ISurfacePointArray_DG
ILabel_DG
ILabelGeometry_DG
ISticky_DG
Collapse BSpline BRep GeometryBSpline BRep Geometry
Collapse Advanced AlgorithmsAdvanced Algorithms
IBRepChamfer_DG
IBRepDraftAngle_DG
IBRepFillet_DG
IFeaturePrism_DG
IBRepShape_DG
IBRepVertex_DG
IBRepEdge_DG
IBRepWire_DG
IBRepFace_DG
IBRepShell_DG
IBRepSolid_DG
IBRepCompositeSolid_DG
IBRepCompound_DG
IShapeArray_DG
IBRepBuilderEx_DG
IWireArrayToSurfaceBuilder_DG
IBRepGeometry_DG
IBRepBuilder_DG
Collapse Mesh GeometryMesh Geometry
IMesh_DG
IMeshGeometry_DG
IVertex_DG
IVertexSegment_DG
ISimplex_DG
IMeshPoint_DG
IMeshAlgor_DG
IDiffSurface_DG
Collapse AppearenceAppearence
IAppearance_DG
IColor
IMaterial_DG
ITexture_DG
ILineStyle_DG
Collapse MovementMovement
Collapse Collision DetectionCollision Detection
IMetrics_DG
IPathCollisionDetector_DG
IKinematicEntity_DG
IMove_DG
IKinematicSet_DG
ICutEffect_DG
ISpinEffect_DG
IConstraint_DG
Collapse ItemsItems
IModelItem_DG
IItemArray_DG
IDynamicScreenItem_DG
IDynamicScreenItemManager_DG
ISmartLabelManager_DG
Collapse Import / ExportImport / Export
IDataContext_DG
ISTLDataContext_DG
Collapse Operations and AgorithmsOperations and Agorithms
IBooleanEntity_DG
IEuclideanShortestPath_DG
Collapse User DataUser Data
IUserData_DG
Collapse ViewView
IView_DG
ISelection_DG
IScene_DG
ILighting_DG
ILightSource_DG
IViewPoint_DG
IViewPointArray_DG
IMeasurement_DG
IRectangleColor_DG
I2DEditor_DG
IVirtualView_DG
Collapse General ComputingGeneral Computing
IObjectGenerator_DG
IControlInitialisationContext_DG
IGlobalAPI_DG
Collections
IUnknown
IObject_DG
IBitmap_DG
IBlob_DG
IContext_DG
IError_DG
IKCStack
IMenu_KC
IMenuItem_KC
IText
IFont_DG
Collapse ViewsViews
View
Scene
Global Axes
Background
3D Background
Collapse Samples and TutorialsSamples and Tutorials
Sample List
.NET Samples
Delphi and C++ Samples
Collapse GraphicsGraphics
Concepts
3D View
Viewing Volume
Eye Frame
Perspective View
Collapse Math ObjectsMath Objects
Mathematical Objects
Planes
Frames
Transforms
Oriented Objects
Boxes
Collapse CurvesCurves
Curve Technologies
Native Curves
Collapse 2D Elements2D Elements
Geometric Elements
Arcs
Line Strips
Collapse DeprecatedDeprecated
Collapse Deprecated GeometryDeprecated Geometry
Collapse 3DS3DS
Profiles
Surface Patches
Surfaces and Patch Strips
Input Validation
Collapse Lines and CurvesLines and Curves
3DS Curves
Surface Of Revolution
Collapse Deprecated API ReferenceDeprecated API Reference
Collapse ModelModel
Collapse SectionSection
IBoundary
Collapse 3DS3DS
IProfiles
IProfiledElement_KC
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Go to DGKC docs Search Documentation


IMeshMods(64) Interface

SetVertexCoord
SetNormal
FixupNormals
Offset
Clear
ClearList
Begin
End
SwapSide
ToLocal
ToGlobal

This interface allows modification of the meshed surface, which implements it. Note that these modifications are low- level ones. Special care has to be taken to ensure that normals are setup and directed correctly. IMeshMods can be queried from IMesh interface.

Note that in case of a parametric surfaces (See Generic 3D Object) any modifications of the surface parameters (for example via IElement ) and subsequent call to UpdateSurface method of DG Kernel control or call for Update method of IModel interface will remove any modifications performed directly. 

Methods of this interface requires a call to IModel.Update() or DG Kernel.UpdateSurface() for changes to appear in 3D view

See more at Meshed Surface Modifications

See also Morph sample, IMesh, Interface List 


HRESULT SetVertexCoord(POSN vertex, double x, double y, double z )

Parameters

vertex - [in] position of the vertex in vertex list of the mesh.

x, y, z - [in] - New coordinates of the vertex.

Returns

S_OK in case of success.
Remarks:

This method allows direct manipulation of vertices in the mesh. 


HRESULT SetNormal(POSN vertex, double vx, double vy, double vz )

Parameters

vertex - [in] position of the vertex in vertex list of the mesh.

vx, vy, vz- [in] - New coordinates of the normal.

Returns

S_OK in case of success.
Remarks:

This method allows direct manipulation or normals in the mesh. Note that when there is a singularity at the point, the surface can have several normals. In this case the modification is applied to the first normal. To modify other normals use IVertex interface, which can be obtained via path: IMesh->IMeshEx->IMeshEx.GetVertex->IVertex


HRESULT FixupNormals(double creaseDegrees, double tolerDegrees)

Parameters

creaseDegrees - [in] Crease angle in degrees.

tolerDegrees- [in] - Tolerance Angle in degrees.

Returns

S_OK in case of success.
Remarks:

This method recalculates all normals in the mesh. It is useful in Mesh Entities, which are normally created on import of objects from external formats. In this case normals are created directly by reading from the file without relating them to the geometry of the surface. FixupNormals allows correcting possible problems with supplied normals.

Note that the method should be used judiciously because sometimes problems with normals are caused by incorrect underlying mesh, in which case the result may be undesirable or there where some other reasons for supplying that sort of normals.

The Crease Angle is the angle used to determine whether two adjoin simplexes form a sharp edge. All neighbor simplexes with angle between their planes under creaseDegrees will be considered as a part of smooth surface.

If angle between the old normal and newly recalculated normal is less than the Tolerance Angle, the normal will be left unchanged. Set tolerDegrees to a negative or zero to skip performing this test.

Note: for singular vertexes (vertexes with several normals) the method may change numbering of the normals. See also IVertex.


HRESULT Offset(double dist)

Parameters

dist - [in] Offset distance. Can be negative

Remarks:

This method translates every vertex in the mesh along its normal by the specified distance. When a vertex has several normals (edge or corner) an average direction is used instead. dist can be negative, in which case the object will appear shrunk, otherwise the surface will appear expanded.

Note that generally offsetting a surface by large distance can create self interentitys and sharp edges.


HRESULT Clear()

Remarks:

Deletes all elements form the mesh. As the result the object will not have a visible surface


HRESULT ClearList(int dim)

Parameters

dim -[in] Identifies type of elements to delete: 0 - verticies, 1 - segments, 2 - simplexes

Remarks:

Deletes relevant elements from the list. Notice often as the result the mesh will be an invalid state. When mesh is not empty either new elements of dim type have to be added of elements of the other dimention need to be removed before rendering or otherwise using the object


HRESULT Begin()

Remarks:

Call this method to notify the software about series of mesh modification calls. See remarks for the End() method below. Call for this method should be followed by call to the End() method in the end of the series. This method affects only performance of mesh manipulation.


HRESULT End(int action)

Parameters

action - [in] Specifies method of updating normals to to be performed. Valid values are enumerated in EMeshModsAction. See remarks

Remarks:

Mesh modifications performed via calls to IMeshTopol.AddSimplex and IVertex.SetVertexCoord automatically recalculate normals at adjacent vertices or modify some internal data. This slows down execution when a large mesh is being built up or massively modified. To improve perfomance in this situation call IMeshMods.Begin() before the series of modification calls and call IMeshMods.End() in the end of the series. See more at Meshed Surface Modifications

Valid values for the action parameter are enumerated in EMeshModsAction:

eMeshActionNone - End the modification series without any additional calculations. Use this option when vertex normals are recalculated and set using IVertex.SetNormal() or other method by the application itself
eMeshActionNormalsFastApprox - Recalculate adjacent normals using approximate but fast method. Use this option for very dense mesh when precise normals are less important
eMeshActionNormalsMedium - Recalculate adjacent normals using method which is not completely accurate but gives good performance
eMeshActionNormalsFull - Recalculate adjacent normals using the most accurate calculation. This option is the slowest for large meshes
eMeshActionNormalsAuto - Automatically select one of the above methods depending on size of the mesh and performance of the computer. In this case the software estimates time to execute the calculation. If the estimated time is less than MeshModsAutoUpdateLimit0 eMeshActionNormalsFull algorithm is used. Otherwise if If the estimated time is less than MeshModsAutoUpdateLimit1 eMeshActionNormalsMedium algorithm is used. Otherwise eMeshActionNormalsFastApprox method is executed. Notice that MeshModsAutoUpdateLimit* parameters can be tuned in using the component context

The Begin()/End() sequence is not required and does not improve performance of a single isolated mesh modification call.


HRESULT SwapSide()

Changes positive side of the mesh. Re-orders vertices of every simplex to keep it in Counter Clock Wise order and changes direction of all normals to the opposite


HRESULT ToLocal(IFrame* frame)

Makes cordinates of all elements in this mesh relative to frame


HRESULT ToGlobal(IFrame* frame)

Assuming this mesh is relative to frame converts all elements to global axes