コード例 #1
0
        private void CreateBase(List <MeshGroup> meshesList, List <ScaleRotateTranslate> meshTransforms, List <PlatingMeshGroupData> platingDataList)
        {
            if (meshesList.Count > 0)
            {
                AxisAlignedBoundingBox bounds = meshesList[0].GetAxisAlignedBoundingBox(meshTransforms[0].TotalTransform);
                for (int i = 1; i < meshesList.Count; i++)
                {
                    bounds = AxisAlignedBoundingBox.Union(bounds, meshesList[i].GetAxisAlignedBoundingBox(meshTransforms[i].TotalTransform));
                }

                double          roundingScale = 20;
                RectangleDouble baseRect      = new RectangleDouble(bounds.minXYZ.x, bounds.minXYZ.y, bounds.maxXYZ.x, bounds.maxXYZ.y);
                baseRect.Inflate(2);
                baseRect *= roundingScale;
                RoundedRect baseRoundedRect = new RoundedRect(baseRect, 1 * roundingScale);

                Mesh baseMeshResult = VertexSourceToMesh.Extrude(baseRoundedRect, unscaledBaseHeight / 2 * roundingScale * sizeScrollBar.Value * heightScrollBar.Value);

                baseMeshResult.Transform(Matrix4X4.CreateScale(1 / roundingScale));

                meshesList.Add(new MeshGroup(baseMeshResult));
                platingDataList.Add(new PlatingMeshGroupData());
                meshTransforms.Add(ScaleRotateTranslate.CreateTranslation(0, 0, 0));
                PlatingHelper.CreateITraceableForMeshGroup(platingDataList, meshesList, meshesList.Count - 1, null);
            }
        }
コード例 #2
0
        private void CreateUnderline(List <MeshGroup> meshesList, List <ScaleRotateTranslate> meshTransforms, List <PlatingMeshGroupData> platingDataList)
        {
            if (meshesList.Count > 0)
            {
                AxisAlignedBoundingBox bounds = meshesList[0].GetAxisAlignedBoundingBox(meshTransforms[0].TotalTransform);
                for (int i = 1; i < meshesList.Count; i++)
                {
                    bounds = AxisAlignedBoundingBox.Union(bounds, meshesList[i].GetAxisAlignedBoundingBox(meshTransforms[i].TotalTransform));
                }

                double xSize          = bounds.XSize;
                double ySize          = sizeScrollBar.Value * 3;
                double zSize          = bounds.ZSize / 3;
                Mesh   connectionLine = PlatonicSolids.CreateCube(xSize, ySize, zSize);
                meshesList.Add(new MeshGroup(connectionLine));
                platingDataList.Add(new PlatingMeshGroupData());
                meshTransforms.Add(ScaleRotateTranslate.CreateTranslation((bounds.maxXYZ.x + bounds.minXYZ.x) / 2, bounds.minXYZ.y + ySize / 2 - ySize * 1 / 3, zSize / 2));
                PlatingHelper.CreateITraceableForMeshGroup(platingDataList, meshesList, meshesList.Count - 1, null);
            }
        }