3d points in WCS from trims


(Karol Wierzbicki) #1

Hi again,

I’m trying to get 3d points from loops (trims), but I only get them in their local coordinate system. How can I get points in world coordinate system?

This is what I do:

        foreach (var trim in loop.Trims)
        {

            var maxAngleRadians = 5 * Math.PI / 180;
            var polyLine = trim.ToPolyline(0, 0, maxAngleRadians, 0.05, 0, 0, 5, 1000, true);
            var listOfPoints = polyLine.ToNurbsCurve().Points;

            for (int i = 0; i < listOfPoints.Count - 1; i++)
            {

                Point3d vertex = listOfPoints[i].Location;
                var hcmVertex = new Vertex();

                hcmVertex.x = vertex.X;
                hcmVertex.y = vertex.Y;
                hcmVertex.z = vertex.Z;

                listOfVertices.Add(hcmVertex);
            }
        }

(Karol Wierzbicki) #2

OK, I have finally used this:
loop.To3dCurve().ToNurbsCurve().Points[i].Location
however I’m not sure how will it behave on different types of surface edges.