Class Surfaces
- Namespace
- CADability.GeoObject
- Assembly
- CADability.dll
Extensions for multiple surfaces
public class Surfaces
- Inheritance
-
Surfaces
- Inherited Members
Constructors
Surfaces()
public Surfaces()
Methods
GetCommonAxis(ISurface, ISurface, out Axis)
The axis both surfaces are rotationally symmetric about, if there is one: two surfaces of revolution (cylinder, cone, torus, surface of revolution) on the same axis, or one of them and a sphere centered on its axis. This is e.g. how the inner and the outer wall of a tube or a bend are recognized as belonging together.
public static bool GetCommonAxis(ISurface surface1, ISurface surface2, out Axis axis)
Parameters
surface1ISurfacefirst surface
surface2ISurfacesecond surface
axisAxisthe common axis, if there is one
Returns
- bool
true, if both surfaces are rotationally symmetric about the same axis
IntersectOnCommonAxis(ISurface, BoundingRect, ISurface, BoundingRect)
Intersects two surfaces which are rotationally symmetric about the same axis. Their intersection can only consist of circles around that axis, and those circles are found in a single plane: the section through the axis gives one or two meridian curves per surface, and every intersection point of these 2d curves marks one circle.
All surfaces implementing ISurfaceOfRevolution qualify, and so does a sphere whose center lies on the axis of the other one - a sphere is a surface of revolution about every axis through its center, it just cannot name one. Two spheres are not handled here, their intersection is a circle around the line through the two centers and SphericalSurface solves it directly.
The result is not trimmed to bounds1 and bounds2, it only covers
the common part; the caller trims to the face boundaries anyway. Returns null when the two surfaces do
not share an axis or when no meridian section could be made - then the general intersection has to do
the work. An empty array means: they share an axis but do not meet.
public static IDualSurfaceCurve[] IntersectOnCommonAxis(ISurface surface1, BoundingRect bounds1, ISurface surface2, BoundingRect bounds2)
Parameters
surface1ISurfacebounds1BoundingRectsurface2ISurfacebounds2BoundingRect
Returns
ParallelDistance(ISurface, BoundingRect, ISurface, BoundingRect, GeoPoint, out GeoPoint2D, out GeoPoint2D)
Find two points on the surfaces, where the connection is perpendicular to both surfaces. Currently used by parametrics to identify faces where we can change the distance. Implemented for two parallel planes and for a plane and a cylinder whose axis is parallel to the plane.
public static bool ParallelDistance(ISurface surface1, BoundingRect domain1, ISurface surface2, BoundingRect domain2, GeoPoint preferredPoint, out GeoPoint2D uv1, out GeoPoint2D uv2)
Parameters
surface1ISurfacethe first surface
domain1BoundingRectthe used part of the first surface
surface2ISurfacethe second surface
domain2BoundingRectthe used part of the second surface
preferredPointGeoPointwhen there are several solutions, the one closest to this point is returned (may be invalid)
uv1GeoPoint2Dthe point on the first surface
uv2GeoPoint2Dthe point on the second surface
Returns
- bool
true, if such a pair of points was found