IRectangularTrimmedSurface_DG Interface
Properties
- RectangleDg Trim
- IUVSurface_DG Surface //The basis surface
Methods
- GetTrimRange
- GetTrimRange
- SetTrimRange
- SetTrimRange
The interface represents a surface which is a part of another basis surface defined by a rectangular subset of its parameters.
Normally IRectangularTrimmedSurface_DG is obtained via query IEntity_DG > GetGeometry() > IGeometry_DG > query/cast IBRepGeometry_DG > Shape property > query/cast IBRepSolid_DG > GetOuterShell() > GetFace() > Surface property > IUVSurface_DG > query IRectangularTrimmedSurface_DG.
Example (C#):
// Returns either length or -1
double GetAxisIfTheSurfaceIsCylindricalTrimmed(IUVSurface_DG surfaceUV, out LineDg axis)
{
axis = null;
ESurfaceType_DG type = surfaceUV.GetSurfaceType();
if (type == ESurfaceType_DG.RectangularTrimmed)
{
IRectangularTrimmedSurface_DG trimmedSurf = surfaceUV.As<IRectangularTrimmedSurface_DG>();
IUVSurface_DG uvSurfBasis = trimmedSurf.Surface;
ESurfaceType_DG typeBase = uvSurfBasis.GetSurfaceType();
if (typeBase == ESurfaceType_DG.Cylinder)
{
ICylinder_DG cylind = uvSurfBasis.As<ICylinder_DG>();
IFrame_DG frame = cylind.Location;
axis = frame.GetAxisRay(2);
RangeDg rg = trimmedSurf.GetTrimRange(false);
return rg.GetLength();
}
}
return -1.0;
}
A new object implementing IRectangularTrimmedSurface_DG can be constructed as (example):
IObjectGenerator_DGPtr gen = m_iModel;
ICylinder_DG iCylinder = gen.Create("ICylinder_DG").As<ICylinder_DG>();
IUVSurface_DG iSurfBase = iCylinder.As<IUVSurface_DG;>
IRectangularTrimmedSurface_DG iSurfTrimmed = gen.Create("IRectangularTrimmedSurface_DG", iSurfBase).As<IRectangularTrimmedSurface_DG>();
Or:
IObjectGenerator_DGPtr gen = m_iModel;
ICylinder_DG iCylinder = gen.Create("ICylinder_DG").As<ICylinder_DG>();
IUVSurface_DG iSurfBase = iCylinder.As<IUVSurface_DG;>
double uMin, uMax, vMin, vMax;
iSurfBase.GetParameterRange(true, out uMin, out uMax);
iSurfBase.GetParameterRange(false, out vMin, out vMax);
IDictionary_DG context = gen.Create("IDictionary_DG");
context.SetInterface("Basis", iSurfBase);
context.SetDouble("uMin", uMin);
context.SetDouble("uMax", uMax);
context.SetDouble("vMin", vMin);
context.SetDouble("vMax", vMax);
IRectangularTrimmedSurface_DG iSurfTrimmed = gen.Create("IRectangularTrimmedSurface_DG", context).As<IRectangularTrimmedSurface_DG>();
Implements also: IGeometricObject_DG, IObject_DG.
void GetTrimRange(bool u, out double min, out double max)
RangeDg GetTrimRange(bool u)
void SetTrimRange(bool u, double min, double max)
void SetTrimRange(bool u, RangeDg range)
|