예제 #1
0
 public StepAxis2Placement3D(string name, StepCartesianPoint location, StepDirection axis, StepDirection refDirection)
     : base(name)
 {
     Location     = location;
     Axis         = axis;
     RefDirection = refDirection;
 }
예제 #2
0
파일: StepLine.cs 프로젝트: suruz/Step
        public static StepLine FromPoints(double x1, double y1, double z1, double x2, double y2, double z2)
        {
            var start  = new StepCartesianPoint("", x1, y1, z1);
            var dx     = x2 - x1;
            var dy     = y2 - y1;
            var dz     = z2 - z1;
            var length = Math.Sqrt(dx * dx + dy * dy + dz * dz);
            var dxn    = dx / length;
            var dyn    = dy / length;
            var dzn    = dz / length;
            var vector = new StepVector("", new StepDirection("", dxn, dyn, dzn), length);

            return(new StepLine("", start, vector));
        }
        internal static StepRepresentationItem FromTypedParameter(StepBinder binder, StepItemSyntax itemSyntax)
        {
            StepRepresentationItem item = null;

            if (itemSyntax is StepSimpleItemSyntax)
            {
                var simpleItem = (StepSimpleItemSyntax)itemSyntax;
                switch (simpleItem.Keyword)
                {
                case StepItemTypeExtensions.AdvancedFaceText:
                    item = StepAdvancedFace.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.Axis2Placement2DText:
                    item = StepAxis2Placement2D.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.Axis2Placement3DText:
                    item = StepAxis2Placement3D.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.BSplineCurveWithKnotsText:
                    item = StepBSplineCurveWithKnots.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.CartesianPointText:
                    item = StepCartesianPoint.CreateFromSyntaxList(simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.CircleText:
                    item = StepCircle.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.CylindricalSurfaceText:
                    item = StepCylindricalSurface.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.DirectionText:
                    item = StepDirection.CreateFromSyntaxList(simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.EdgeCurveText:
                    item = StepEdgeCurve.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.EdgeLoopText:
                    item = StepEdgeLoop.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.EllipseText:
                    item = StepEllipse.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.FaceBoundText:
                    item = StepFaceBound.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.FaceOuterBoundText:
                    item = StepFaceOuterBound.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.LineText:
                    item = StepLine.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.OrientedEdgeText:
                    item = StepOrientedEdge.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.PlaneText:
                    item = StepPlane.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.VectorText:
                    item = StepVector.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                case StepItemTypeExtensions.VertexPointText:
                    item = StepVertexPoint.CreateFromSyntaxList(binder, simpleItem.Parameters);
                    break;

                default:
                    if (UnsupportedItemTypes.Add(simpleItem.Keyword))
                    {
                        Debug.WriteLine($"Unsupported item {simpleItem.Keyword} at {simpleItem.Line}, {simpleItem.Column}");
                    }
                    break;
                }
            }
            else
            {
                // TODO:
            }

            return(item);
        }
예제 #4
0
 public StepVertexPoint(string name, StepCartesianPoint location)
     : base(name)
 {
     Location = location;
 }
예제 #5
0
파일: StepLine.cs 프로젝트: suruz/Step
 public StepLine(string label, StepCartesianPoint point, StepVector vector)
     : base(label)
 {
     Point  = point;
     Vector = vector;
 }
예제 #6
0
 public StepAxis2Placement2D(string label, StepCartesianPoint location, StepDirection direction)
     : base(label)
 {
     Location     = location;
     RefDirection = direction;
 }