コード例 #1
0
        public static void CreateCube(double dimX, double dimY, double dimZ, double cubeX = 0, double cubeY = 0, double cubeZ = 0)
        {
            StepPart part = new StepPart();
            StepShapeDefinitionRepresentation   shapeRep  = new StepShapeDefinitionRepresentation();
            StepProductDefinitionShape          defnShape = new StepProductDefinitionShape();
            StepAdvancedBrepShapeRepresentation brepShapeRepresentation = new StepAdvancedBrepShapeRepresentation();

            StepAxis2Placement axis = new StepAxis2Placement();

            SetDefaultAxis(cubeX, cubeY, cubeZ, axis);


            //Create base face
            double x1, x2, y1, y2;

            double xPlus = 0, xMinus = 0;
            double yPlus = 0, yMinus = 0;
            double zPlus = 0, zMinus = 0;

            GeneratePlusMinusValues(dimZ, out zPlus, out zMinus);

            GenerateRectangularFaceVertices(dimX, dimY, out xPlus, out yPlus, out xMinus, out yMinus);
        }
コード例 #2
0
ファイル: StepWriter.cs プロジェクト: ZhangWebber/Step2XML
        public List <StepStyledItem> GetStyledItems(StepAdvancedBrepShapeRepresentation item)
        {
            var styledItems = new List <StepStyledItem>();

            if (item.UsedSolidBrepList != null && item.UsedSolidBrepList.Count > 0)
            {
                foreach (var solidBrep in item.UsedSolidBrepList)
                {
                    foreach (var eachItem in _file.Items)
                    {
                        if (eachItem.ItemType == StepItemType.StyledItem)
                        {
                            var itemInstance = (StepStyledItem)eachItem;
                            if (itemInstance.UsedSolidBrep != null && itemInstance.UsedSolidBrep.Id == solidBrep.Id)
                            {
                                styledItems.Add(itemInstance);
                            }
                        }
                    }
                }
            }

            return(styledItems);
        }