new Roofs()
A factory for generating a range of different roof forms and shapes
based on the PD.Shape class.
Methods
-
anticupola( [config]) <static>
-
Generates a anticupola-shaped roof.
An anticupola is a shape formed by joining two polygons, one (the base) with twice as many edges as the other and rotated slightly by half a segment, joined to the top by a band of isosceles triangles.
Parameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
detailnumber <optional>
The level of geometric detail (0 to 32), defaults to 8.
pointsnumber <optional>
The number of points in random and Fibonacci domes (2 to 1024), defaults to 128.
typenumber | string <optional>
What type of dome to create (0:latLng, 1:Geodesic, 2: random), defaults to 0.
Returns:
Returns a new anticupola roof shape.
- Type
- PD.Shape
-
barrel( [config]) <static>
-
Generates a simple barrel vault roof.
A barrel vault roof is formed from a series of planes that form a semicircular arch at each end. The number of planes is determined by the facet resolution. A rainbow roof is very similar, but forms a pointed arch instead of a semicircular one.
The
config.verticesproperty is an array that you can pre-fill with up to four initial points defining the corners of the base. These points must define a convex coplanar quadrilateral, with the order of vertices as shown below. This final shape actually requires six (6) points, or ten (10) if it has a gutter (), where the 4 and 5 will be automatically computed based on the roof pitch angle.You can specify the roof pitch angle(s) in degrees using
config.angleor in radians usingconfig.radians. This method will useconfig.angleoverconfig.radians, so you should only include one or the other, not both.3------------------------------------2 +------------------------------------+ | | +------------------------------------+ | | | | +------------------------------------+ | | , - ~ ' ~ - , | | , ' ' , +------------------------------------+ , , | | , , +------------------------------------+ , , 0------------------------------------1 1 - - - - - - - - 2 - + - +---------------------------+ - + - gutterParameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
facetsnumber <optional>
The number of facets (2 to 72), defaults to 12.
isRainbowboolean <optional>
Whether to generate a ridged rainbow roof instead of a barrel, defaults to false.
Returns:
Returns a new barrel vaulted roof shape.
- Type
- PD.Shape
-
butterfly( [config]) <static>
-
Creates simple butterfly roof, which is basically an inverted gable.
A butterfly roof consists of two inclined planes that meet in the middle of a base quadrilateral to form a central valley. As opposed to a gable roof, the planes are generated from the center value and incline upwards towards the sides.
The
config.verticesproperty is an array that you can pre-fill with up to four initial points defining the corners of the base. These points must define a convex coplanar quadrilateral, with the order of vertices as shown below. This final shape actually requires six (6) points, or ten (10) if it has a gutter (), where the 4 and 5 will be automatically computed based on the roof pitch angle.You can specify the roof pitch angle in degrees using
config.angleor in radians usingconfig.radians. This method will useconfig.angleoverconfig.radians, so you should only include one or the other, not both.9 8 3-----------------------------------2 \ _/ \ _/ 5---------------------------4 (1)._ _.(2) \ _/ : '-._ _.-' : \ _/ : '-4-' : 0-------------------1 1 - - - - - - - 2 - + - 6 7 7-----------------------8 - + - baseParameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
anglenumber <optional>
The roof pitch in degrees (0.1 to 75deg), defaults to 30deg.
radiansnumber <optional>
The roof pitch in radians, defaults to 0.5236rad.
valleyWidthnumber <optional>
The width of the valley gutter in the middle, defaults to 0.
valleyDepthnumber <optional>
The depth of the valley gutter in the middle, defaults to 100mm.
Returns:
Returns a new butterfly roof shape.
- Type
- PD.Shape
-
conical( [config]) <static>
-
Generates a simple conical roof.
A cone is a cylindrical shaped roof with the top radius that different from the bottom radius, often being just a single point, and formed from a series of facets that approximate its curved shape.
The
config.verticesproperty is an array that you can pre-fill with up to four initial points defining the corners of the base. These points must define a convex coplanar quadrilateral. If you provide just one point, it will be used as the center of the cone. If you provide two points, the second is assumed to define a point on the circumference of the cone, so is used to compute the radius. If you provide three or four points, these will be used to generate the radius such that the circumference is tangential to all two/three lines.All conical shapes generated by this class use facets to approximate the curved shape of the dome. To generate smoothly curved algorithmic domed surfaces, use the OpenCascade engine or the PD.BRep class. You can control the facet density using the
detailorpointsconfiguration properties described below.Parameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
sidesnumber <optional>
The number of side facets (3 to 360), defaults to 36.
radiusnumber <optional>
The radius of the base of the cone, defaults to given size.
radiusTopnumber <optional>
The radius of the top of the cone, defaults to 0.
heightnumber <optional>
The height to the top of the cone, defaults to 1000mm.
Returns:
Returns a new domed roof shape.
- Type
- PD.Shape
-
cupola( [config]) <static>
-
Generates a cupola-shaped roof.
A cupola is a shape formed by joining two polygons, one (the base) with twice as many edges as the other, by an alternating band of isosceles triangles and rectangles.
Parameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
detailnumber <optional>
The level of geometric detail (0 to 32), defaults to 8.
pointsnumber <optional>
The number of points in random and Fibonacci domes (2 to 1024), defaults to 128.
typenumber | string <optional>
What type of dome to create (0:latLng, 1:Geodesic, 2: random), defaults to 0.
Returns:
Returns a new cupola roof shape.
- Type
- PD.Shape
-
dome( [config]) <static>
-
Generates a simple dome roof.
A dome is a hemispherical shaped roof formed from a series of facets that approximate its curved shape.
The
config.verticesproperty is an array that you can pre-fill with up to four initial points defining the corners of the base. These points must define a convex coplanar quadrilateral. If you provide just one point, it will be used as the center of the dome. If you provide two points, the second is assumed to define a point on the circumference of the dome, so is used to compute the radius. If you provide three or four points, these will be used to generate the radius such that the circumference is tangential to all two/three lines.All dome shapes generated by this class use facets to approximate the curved shape of the dome. To generate smoothly curved algorithmic domed surfaces, use the OpenCascade engine or the PD.BRep class. You can control the facet density using the
detailorpointsconfiguration properties described below., - ~ ' ~ - , , - ~ ' ~ - , , ' ' , , ' ' , , , , , , , , , , , , , + - - - - 0 - - - - 1 + - - - - - - - - + - + - +---------------------------+ - + - baseParameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
detailnumber <optional>
The level of geometric detail (0 to 32), defaults to 8.
pointsnumber <optional>
The number of points in random and Fibonacci domes (2 to 1024), defaults to 128.
typenumber | string <optional>
What type of dome to create (0:latLng, 1:Geodesic, 2: random), defaults to 0.
Returns:
Returns a new domed roof shape.
- Type
- PD.Shape
-
gable( [config]) <static>
-
Generates a simple gable roof.
A gable roof consists of two inclined planes that meet in the middle of a base quadrilateral to form a raised central ridge.
The
config.verticesproperty is an array that you can pre-fill with up to four initial points defining the corners of the base. These points must define a convex coplanar quadrilateral, with the order of vertices as shown below. This final shape actually requires six (6) points, or ten (10) if it has a gutter (), where the 4 and 5 will be automatically computed based on the roof pitch angle.You can specify the roof pitch angle in degrees using
config.angleor in radians usingconfig.radians. This method will useconfig.angleoverconfig.radians, so you should only include one or the other, not both.9 8 3-----------------------------------2 \ _/ \ _/ 5---------------------------4 _.-._ \ _/ _.-' '-._ \ _/ _.-' '-._ 0-------------------1 1 - - - - - - - - 2 - + - 6 7 +---------------------------+ - + - baseParameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
anglenumber <optional>
The roof pitch in degrees (0.1 to 75deg), defaults to 30deg.
radiansnumber <optional>
The roof pitch in radians, defaults to 0.5236rad.
Returns:
Returns a new gable roof shape.
- Type
- PD.Shape
-
gambrel( [config]) <static>
-
Generates a simple gambrel roof.
A gambrel roof consists of four inclined planes, where the bottom two planes are inclined at different angles to the top two planes.
The
config.verticesproperty is an array that you can pre-fill with up to four initial points defining the corners of the base. These points must define a convex coplanar quadrilateral, with the order of vertices as shown below. This final shape actually requires six (6) points, or ten (10) if it has a gutter (), where the 4 and 5 will be automatically computed based on the roof pitch angle.You can specify the roof pitch angle(s) in degrees using
config.angleor in radians usingconfig.radians. This method will useconfig.angleoverconfig.radians, so you should only include one or the other, not both.13 12 3------------------------------------2 | | 6------------------------------------7 | | _.-'-._ 8------------------------------------9 _.-' '-._ | | + + 4------------------------------------5 _/ \_ | | _/ \_ 0------------------------------------1 1 - - - - - - - - - 2 - + - 10 11 11---------------------------12 - + - baseParameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
anglenumber <optional>
The lower roof pitch in degrees (0.1 to 75deg), defaults to 60deg.
radiansnumber <optional>
The lower roof pitch in radians, defaults to 0.5236rad.
angleUppernumber <optional>
The upper roof pitch in degrees (0.1 to 75deg), defaults to 30deg.
radiansUppernumber <optional>
The upper roof pitch in radians, defaults to 0.5236rad.
heightnumber <optional>
The height of the lower roof portion, defaults to 1000mm.
Returns:
Returns a new gambrel roof shape.
- Type
- PD.Shape
-
hip( [config]) <static>
-
Generates a simple hip roof.
A hip roof consists of four inclined planes that meet in the middle of a base quad to form a central ridge. The angle of inclination for all planes is typically the same, unless the two end triangular planes intersect each other in which case their angles are modified to create a pyramid shape.
The
config.verticesproperty is an array that you can pre-fill with up to four initial points defining the corners of the base. These points must define a convex coplanar quadrilateral, with the order of vertices as shown below. This final shape actually requires six (6) points, or ten (10) if it has a gutter (), where the 4 and 5 will be automatically computed based on the roof pitch angle.You can specify the roof pitch angle(s) in degrees using
config.angleor in radians usingconfig.radians. This method will useconfig.angleoverconfig.radians, so you should only include one or the other, not both.9 8 3---------------------2 \''.. _/ \ \ ''.. _/ \ \ _5-----4. \ _______ \ _/ ''.. \ _.-' '-._ \ / ''..\ _.-' '-._ 0---------------------1 0----------------------------1 - + - 6 7 6----------------------------7 - + - baseParameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
anglenumber <optional>
The side roof pitch angle in degrees (0.1 to 75deg), defaults to 30deg.
radiansnumber <optional>
The side roof pitch angle in radians, defaults to 0.5236rad.
angleEndnumber <optional>
The end roof pitch angle in degrees(0.1 to 89.9deg), defaults to 30deg.
radiansEndnumber <optional>
The end roof pitch angle in radians, defaults to 0.5236rad.
Returns:
Returns a new hip roof shape.
- Type
- PD.Shape
-
hippedGable( [config]) <static>
-
Generates a simple hipped gable roof.
A hipped gable roof consists of four inclined planes that meet in the middle of a base quad to form a central ridge. The angle of inclination for all planes is typically the same, unless the two end triangular end planes intersect each other in which case their angles are modified to create a pyramid shape.
The
config.verticesproperty is an array that you can pre-fill with up to four initial points defining the corners of the base. These points must define a convex coplanar quadrilateral, with the order of vertices as shown below. This final shape actually requires six (6) points, or ten (10) if it has a gutter (), where the 4 and 5 will be automatically computed based on the roof pitch angle.You can specify the roof pitch angle(s) in degrees using
config.angleor in radians usingconfig.radians. This method will useconfig.angleoverconfig.radians, so you should only include one or the other, not both.13 12 3---------------------2 \ \ 8. _7 \''-. / \ \ '5-----------4. \ _____________________ \ .' ''..\ _/ \_ 9 '6 _/ \_ \ \ : : 0---------------------1 0-----------------------------1 10 11 10---------------------------11 - + - baseParameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
anglenumber <optional>
The side roof pitch angle in degrees (0.1 to 75deg), defaults to 30deg.
radiansnumber <optional>
The side roof pitch angle in radians, defaults to 0.5236rad.
angleEndnumber <optional>
The end roof pitch angle in degrees(0.1 to 89.9deg), defaults to 30deg.
radiansEndnumber <optional>
The end roof pitch angle in radians, defaults to 0.5236rad.
fractionnumber <optional>
The fractional ridge offset of the hip triangles (0 to 1), defaults to 0.5.
Returns:
Returns a new hipped gable roof shape.
- Type
- PD.Shape
-
mansard( [config]) <static>
-
Generates a simple mansard roof.
A mansard roof consists of eight inclined planes, where the bottom four planes are inclined at different angles to the top four planes. A Dutch gable is where the end triangle planes (5,6,8 and 7,4,9) are vertical.
The
config.verticesproperty is an array that you can pre-fill with up to four initial points defining the corners of the base. These points must define a convex coplanar quadrilateral, with the order of vertices as shown below. This final shape actually requires six (6) points, or ten (10) if it has a gutter (), where the 4 and 5 will be automatically computed based on the roof pitch angle.You can specify the roof pitch angle(s) in degrees using
config.angleor in radians usingconfig.radians. This method will useconfig.angleoverconfig.radians, so you should only include one or the other, not both.3------------------------------------2 |'. .'| | 7----------------------------6 | ____________ | | '. .' | | _.-' '-._ | | 9--------------------8 | | _.-' '-._ | | .' '. | | +----------------------------------+ | 4----------------------------5 | _/ \_ |.' '.| _/ \_ 0------------------------------------1 0--------------------------------------------1 - + - +--------------------------------------------+ - + - baseParameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
anglenumber <optional>
The lower roof pitch in degrees (0.1 to 75deg), defaults to 60deg.
radiansnumber <optional>
The lower roof pitch in radians, defaults to 0.5236rad.
angleUppernumber <optional>
The upper roof pitch in degrees (0.1 to 75deg), defaults to 30deg.
radiansUppernumber <optional>
The upper roof pitch in radians, defaults to 0.5236rad.
dutchGablenumber <optional>
The factor for turning the mansard shape into a Dutch gable (0 to 1), defaults to 0.
heightnumber <optional>
The height of the lower roof portion, defaults to 1000mm.
Returns:
Returns a new mansard roof shape.
- Type
- PD.Shape
-
pavilion( [config]) <static>
-
Generates a simple pavilion roof.
A pavilion roof consists of four inclined planes that all meet at a central apex point to form a pyramid.
The
config.verticesproperty is an array that you can pre-fill with up to four initial points defining the corners of the base. These points must define a convex coplanar quadrilateral, with the order of vertices as shown below. This final shape actually requires six (6) points, or ten (10) if it has a gutter (), where the 4 and 5 will be automatically computed based on the roof pitch angle.You can specify the roof pitch angle(s) in degrees using
config.angleor in radians usingconfig.radians. This method will useconfig.angleoverconfig.radians, so you should only include one or the other, not both.3---------------2 \''.. _/ \ \ ''.. _/ \ \ _4 \ \ _/ ''.. \ _.-'-._ \ / ''..\ _.-' '-._ 0---------------1 0-------------------1 - + - +-------------------+ - + - gutterParameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
anglenumber <optional>
The lower roof pitch in degrees (0.1 to 75deg), defaults to 60deg.
radiansnumber <optional>
The lower roof pitch in radians, defaults to 0.5236rad.
Returns:
Returns a new pavilion roof shape.
- Type
- PD.Shape
-
rotunda( [config]) <static>
-
Generates a pentagonal rotunda roof.
As this shape always has 10 sides in its base, the
sidesvalue refers to the number of unit-sized cylindrical segments to add to its base.Parameters:
Name Type Argument Description configobject <optional>
A configuration object.
Properties of
config:Name Type Argument Description verticesArray.<Array.<number>> <optional>
An array of 1 to 4 [x,y,z] vector array initial corner points.
sizenumber | Array.<number> <optional>
The base size as a number or [sizeX,sizeY] vector array, defaults to 2000mm.
basenumber <optional>
The height of the base/gutter at the bottom, defaults to 150mm.
detailnumber <optional>
The level of geometric detail (0 to 32), defaults to 8.
pointsnumber <optional>
The number of points in random and Fibonacci domes (2 to 1024), defaults to 128.
typenumber | string <optional>
What type of dome to create (0:latLng, 1:Geodesic, 2: random), defaults to 0.
Returns:
Returns a new rotunda roof shape.
- Type
- PD.Shape