Interface ITransform3D

Namespace
ESRI.ArcGIS.Geometry
Assembly
ESRI.Server.Geometry.dll

Provides access to methods for transforming 3D geometries using either specific parameters or arbitrary transformation objects.

[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("9414E949-FFA0-11D3-9F56-00C04F6BDF0D")]
public interface ITransform3D

Remarks

These methods are intended to be called against top-level geometries only (Point, Polyline, Polygon, MultiPatch). To call a method against a Segment/Path or Ring, first add the part to a Polyline or Polygon container, respectively, and then call the appropriate method against the container.

[C#]

 

        public static void TransformMultiPatchGeometry()

        {

            const double XScale = 0.5;

            const double YScale = 0.5;

            const double ZScale = 2;

            const double XOffset = -5;

            const double YOffset = -5;

            const double ZOffset = -8;

            const double DegreesOfRotation = 90;

 

            //Transform3D: Cylinder Scaled, Rotated, Repositioned Via Move3D(), Scale3D(), RotateVector3D()

 

            IGeometry geometry = GetMultiPatchGeometry();

 

            ITransform3D transform3D = geometry as ITransform3D;

 

            //Stretch The Cylinder So It Looks Like A Tube

 

            IPoint originPoint = ConstructPoint3D(0, 0, 0);

 

            transform3D.Scale3D(originPoint, XScale, YScale, ZScale);

 

            //Rotate The Cylinder So It Lies On Its Side

 

            IVector3D axisOfRotationVector3D = ConstructVector3D(0, 10, 0);

 

            double angleOfRotationInRadians = GetRadians(DegreesOfRotation);

 

            transform3D.RotateVector3D(axisOfRotationVector3D, angleOfRotationInRadians);

 

            //Reposition The Cylinder So It Is Located Underground

 

            transform3D.Move3D(XOffset, YOffset, ZOffset);

        }  

 

        private static IPoint ConstructPoint3D(double x, double y, double z)

        {

            IPoint point = ConstructPoint2D(x, y);

            point.Z = z;

           

return point;

        }




        private static IPoint ConstructPoint2D(double x, double y)

        {

            IPoint point = new PointClass();

            point.PutCoords(x, y);
 

            return point;

        }

        private static double GetRadians(double decimalDegrees)

        {

            return decimalDegrees * (Math.PI / 180);

        }


 

        private static IVector3D ConstructVector3D(double xComponent, double yComponent, double zComponent)

        {

            IVector3D vector3D = new Vector3DClass();

            vector3D.SetComponents(xComponent, yComponent, zComponent);


 

            return vector3D;

        }

 

Methods

Move3D(double, double, double)

Moves the object by dx, dy and dz along the x, y, and z axes respectively.

void Move3D(double dx, double dy, double dz)

Parameters

dx double
dy double
dz double

MoveVector3D(IVector3D)

Moves the object by an offset defined by a 3D vector.

void MoveVector3D(IVector3D v)

Parameters

v IVector3D

ProjectToPlane(IPoint, IVector3D, IVector3D)

Generates a polygon footprint for the object in an arbitrary plane. The footprint may have multiple parts.

IGeometry ProjectToPlane(IPoint planarOrigin, IVector3D planarPositiveX, IVector3D planarNorm)

Parameters

planarOrigin IPoint
planarPositiveX IVector3D
planarNorm IVector3D

Returns

IGeometry

Remarks

This method can be used to get the xy-footprint of a multipatch if set all the parameters to Null.


[C#]

 

        public static void TransformMultiPatchGeometry()

        {

            //Transform3D: Cylinder Projected To XY Plane Via ProjectToPlane()

 

            //Define Origin At Which ProjectToPlane Operation Should Be Performed


            IPoint planarOriginPoint = ConstructPoint3D(0, 0, 0);

 

            //Construct A Vector3D Corresponding To The Positive X Vector

 

            IVector3D planarPositiveXVector3D = ConstructVector3D(10, 0, 0);

 

            //Construct A Vector3D Corresponding To The Normal Vector

 

            IVector3D planarNormalVector3D = ConstructVector3D(0, 0, 10);

 

            IGeometry geometry = GetMultiPatchGeometry();

 

            ITransform3D transform3D = geometry as ITransform3D;

 

IGeometry

projectedGeometry =

transform3D.ProjectToPlane(

planarOriginPoint, 

 

                          planarPositiveXVector3D,

planarNormalVector3D

                   );

        }

        private static IVector3D ConstructVector3D(double xComponent, double yComponent, double zComponent)

        {

            IVector3D vector3D = new Vector3DClass();

            vector3D.SetComponents(xComponent, yComponent, zComponent);

 

            return vector3D;

        }




RotateVector3D(IVector3D, double)

Rotates the object about axis defined by the specified vector through an angle measured in radians.

void RotateVector3D(IVector3D axis, double rotationAngle)

Parameters

axis IVector3D
rotationAngle double

Remarks

The angle of rotation must be in radians. To convert to radians from decimal degrees, multiply by PI/180.

[C#]

 

        public static void TransformMultiPatchGeometry()

        {

            const double DegreesOfRotation = 45;

 

            //Transform3D: Cylinder Rotated Around An Axis Via RotateVector3D()

 

            //Construct A Vector3D Corresponding To The Desired Axis Of Rotation

 

            IVector3D axisOfRotationVector3D = ConstructVector3D(0, 10, 0);

 

            //Obtain Angle Of Rotation In Radians

 

            double angleOfRotationInRadians = GetRadians(DegreesOfRotation);

 

            IGeometry geometry = GetMultiPatchGeometry();

 

            ITransform3D transform3D = geometry as ITransform3D;

            transform3D.RotateVector3D(axisOfRotationVector3D, angleOfRotationInRadians);

        }

        private static IVector3D ConstructVector3D(double xComponent, double yComponent, double zComponent)

        {

            IVector3D vector3D = new Vector3DClass();

            vector3D.SetComponents(xComponent, yComponent, zComponent);

 

            return vector3D;

        }

 

        private static double GetRadians(double decimalDegrees)

        {

            return decimalDegrees * (Math.PI / 180);

        }


Scale3D(IPoint, double, double, double)

Scales the object about the specified origin point. sx, sy, and sz are the scaling factors for the x, y, and z dimensions repectively.

void Scale3D(IPoint Origin, double sx, double sy, double sz)

Parameters

Origin IPoint
sx double
sy double
sz double

Transform3D(esriTransformDirection, ITransformation3D)

Applies an arbitrary 3D transformation.

void Transform3D(esriTransformDirection Direction, ITransformation3D Transformation)

Parameters

Direction esriTransformDirection
Transformation ITransformation3D