Subroutine to draw a pieChart. Although not labelled, note that the actual .scadfile generated contains the labels as comments
my $EnergyUtilisation={Electricity=>4000,Gas=>5100,Petrol=>1000,Coal=>2300};
pieChart($EnergyUtilisation)
Subroutine to create text in a circle
Subroutine to create a box that can folded from a flat shape
Subroutine to create involute gears
Animation using SCAD and Perl
OpenSCAD Uses $t to handle animations. The best way to pass these is using single quotes, for example: -
$scad->polygon("outline",$gear->{points})
->linear_extrude("gear","outline","10")
->color("gear","red")
->rotate("gear",[0,0,'$t*360'])
An extra module Loft.pm allows the creation of lofts betweeen two faces. This can be used to create complex polyhedrons, resulting in an object that renders much quicker than hull.
This used a scadItem object, that keeps the parameters of a shape in a perl object rather than a string. This means that the parameters can be changed, modifying the object in Perl before transformation in the build process into the appropriate script.
This demonstrates loft along path (version 0.17)









