It is Christmas time and we are ready to do some Christmas docoration with Revit. This parametric star can be whatever number pointed (5-pointed, 6-pointed, 7-pointed,…) of any size with sharp points (acute angle at the point) or blunt points (obtuse angle).
Length of leg
Number of legs/points
Angle at vertex (point)/leg
Height of vertex at center
Consider half of a leg as a triangle with the longest side being the length of the leg and angle A at the base and angle B at the vertex.
The geometry of half a leg is simply a pyramid with the triangle as the base and the vertex being at a height H above the point at the base.
The full leg can be formed by two half leg, one being flipped, placed side by side.
Method 1: Traditional Family
Building Half Leg
The half leg pyramid geometry can be considered as a triangular prism along line OR in Fig.1, cut by 2 void extrusions based on triangles OQR and OPN. However this is only true in the case when B < 90°-A. In case when B > 90°-A, (see Fig.2), the prism needs to extend from O to S and the void extrusion has to be based on OPTS.
To model the prism and the voids, parameters were set up as in Fig.1, using reference lines instead of reference planes. In this case reference lines had advantage that they were joined together to form triangles defined by angle A and angle B and the points of the triangle were well located. The reference line at OR could also serve as the path for a sweep to create the prism.
A sweep could be made by picking the reference line at OR with profile being a triangle with base equal to S (where S = L x sin B) and height equal to H.
However in the case when B > 90°-A, the sweep needs to extend at length OS. This extension was created by an extrusion with working plane selected at face of the sweep and extrusion end equals to a parameter E where E is formulated with L x tan B x sin B (OS, see Fig.2).
Two void extrusions were made to finish the half leg and a horizontal control was added to enable flipping.
Building the Full Leg
Simply by nesting the half leg family to a new generic model family and associating all parameters, putting one and another one flipped side by side, a full leg family was created.
Building the Star
The full leg family was nested to another new generic model family. Again all the parameters in the full leg family were associated with parameters in the new family. A parameter “N” (number of legs) was made. The formula A = 360°/(2*N)could make N number of legs complete a circle. The full leg could be arrayed through 360° with the array number parametrized by N.