示例#1
0
        public BCOM.ShapeElement GetContourShape(BCOM.MsdFillMode fillMode = BCOM.MsdFillMode.NotFilled)
        {
            var bounds = new BCOM.Point3d[4];

            bounds[0] = Origin.AddScaled(HeigthVec, -0.5 * Height)
                        .AddScaled(WidthVec, -0.5 * Width);
            bounds[1] = Origin.AddScaled(HeigthVec, 0.5 * Height)
                        .AddScaled(WidthVec, -0.5 * Width);
            bounds[2] = Origin.AddScaled(HeigthVec, 0.5 * Height)
                        .AddScaled(WidthVec, 0.5 * Width);
            bounds[3] = Origin.AddScaled(HeigthVec, -0.5 * Height)
                        .AddScaled(WidthVec, 0.5 * Width);

            var shape = App.CreateShapeElement1(null, bounds, fillMode);

            if (!App.Point3dEqualTolerance(
                    shape.Normal.Normalize(), DepthVec.Normalize(), 0.00005))
            {
                shape.Reverse();
            }
            return(shape);
        }
示例#2
0
        public BCOM.LineElement GetLineContour()
        {
            var bounds = new BCOM.Point3d[5];

            bounds[0] = Origin.AddScaled(HeigthVec, -0.5 * Height)
                        .AddScaled(WidthVec, -0.5 * Width);
            bounds[1] = Origin.AddScaled(HeigthVec, 0.5 * Height)
                        .AddScaled(WidthVec, -0.5 * Width);
            bounds[2] = Origin.AddScaled(HeigthVec, 0.5 * Height)
                        .AddScaled(WidthVec, 0.5 * Width);
            bounds[3] = Origin.AddScaled(HeigthVec, -0.5 * Height)
                        .AddScaled(WidthVec, 0.5 * Width);
            bounds[4] = bounds[0];

            BCOM.LineElement line = App.CreateLineElement1(null, bounds);

            if (!App.Point3dEqualTolerance(
                    line.Normal.Normalize(), DepthVec.Normalize(), 0.00005))
            {
                line.Reverse();
            }
            return(line);
        }