Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Available in TurboCAD Pro and Pro Platinum only

The following code will generate a window. To use the resulting window you must either:

  1. Save the script as a .ppm file, and load the folder containing the file into the symbol library, and then drag the symbol onto a wall.
  2. Run the PPM script. Select the result, and turn it into a block. Finally drag the block from the block palette onto a wall.

3ArchWindow.ppm


Units(1[mm]);

H = Parameter("Window Height", 1200, LINEAR, Interval(400, 10000));

W = Parameter("Window Width", 2000, LINEAR, Interval(700, 10000));
Curvature = Parameter("Curvature", 40, LINEAR, Interval(0, 100));
elevation = Parameter("Window Eleveation", 700, LINEAR, Interval(0, 10000));
sash = Parameter("Window Sash", 30, LINEAR, Interval(0, 100));

W1 = W/3.0;

P00 = Point(0,0);
P10 = Point(0, H);
P11 = Point(W1, H);
P12 = Point(2*W1, H);
P13 = Point(3*W1, H);
P03 = Point(3*W1, 0);

C1 = Point(0.5*(PointX(P10) + PointX(P11)),
0.5*(PointY(P10) + PointY(P11)) - Curvature);

C2 = Point(0.5*(PointX(P11) + PointX(P12)),
0.5*(PointY(P11) + PointY(P12)) - Curvature);

C3 = Point(0.5*(PointX(P12) + PointX(P13)),
0.5*(PointY(P12) + PointY(P13)) - Curvature);

contour = Polyline(P10, Arc0(PointX(C1), PointY(C1)), P11,
Arc0(PointX(C2), PointY(C2)), P12,
Arc0(PointX(C3), PointY(C3)), P13,
P03, P00, P10);


contourZ = RotateX(contour, 90);
ClipContour = SetProperties(contourZ, "#$AUX@_Contour" = 1, "PenColor"= 0x0000ff);
TS = RefPoint (W/2, 0, -elevation);
Output(ClipContour, TS);


PL = Point(sash/2, H);
PR = Point(W1 - sash/2, H);
ArcWind1 = Polyline(Point(sash/2, 0),
Point(sash/2, H),
Arc0(PointX(C1), PointY(C1)),
Point(W1 - sash/2, H),
Point(W1 - sash/2, 0),
Point(sash/2, 0));
ArcWindz1 = RotateX(ArcWind1, 90);

ArcWind2 = Move(ArcWind1, W1, 0, 0);
ArcWindz2 = RotateX(ArcWind2, 90);

ArcWind3 = Move(ArcWind2, W1, 0, 0);
ArcWindz3 = RotateX(ArcWind3, 90);

ArcWindz1D = Thickness(ArcWindz1, sash);
ArcWindz1Surf = SetProperties(ArcWindz1D, "Solid" = 0);

ArcWindz2D = Thickness(ArcWindz2, sash);
ArcWindz2Surf = SetProperties(ArcWindz2D, "Solid" = 0);

ArcWindz3D = Thickness(ArcWindz3, sash);
ArcWindz3Surf = SetProperties(ArcWindz3D, "Solid" = 0);

contourZ3D = Thickness(contourZ, sash);
contourZ3DSurf = SetProperties(contourZ3D, "Solid" = 0);

res1 = BooleanSubtract(contourZ3DSurf, ArcWindz3Surf);
res2 = BooleanSubtract(res1, ArcWindz2Surf);
res3 = BooleanSubtract(res2, ArcWindz1Surf);


Output(res3);

 

  • No labels