From: Ian Jackson Date: Fri, 5 Feb 2016 03:23:53 +0000 (+0000) Subject: commitid.scad.pl: Generate 2D name inside gentextmodule; docs X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=commitdiff_plain;h=e7670cf55a1731afad3fccfa102f8afd2e5a16e3;ds=sidebyside commitid.scad.pl: Generate 2D name inside gentextmodule; docs --- diff --git a/commitid.scad.pl b/commitid.scad.pl index 892ed7e..fbf1231 100755 --- a/commitid.scad.pl +++ b/commitid.scad.pl @@ -15,8 +15,12 @@ $SIG{__WARN__} = sub { die @_; }; # # For each form we have # -# module Commitid_Form_2D(.4) -# module Commitid_Form() +# module Commitid_Form_2D() { ... } +# module Commitid_Form() { ... } +# +# These have their origin in the bottom left corner. The 3D model +# is a positive, has its origin halfway through, and is twice the +# depth in height, so it can be added or subtracted. # # And we provide # @@ -80,8 +84,9 @@ sub chrmodname ($) { } sub gentextmodule ($@) { - my ($modulename, @lines) = @_; - p "module $modulename(){\n"; + my ($form, @lines) = @_; + my $modb = "Commitid_$form"; + p "module ${modb}_2D(){\n"; p " scale(Commitid__scale()){\n"; my $y = @lines; foreach my $line (@lines) { @@ -172,7 +177,7 @@ sub parsefont () { parsefont(); -gentextmodule('Commitid_FontDemo_2D', @demo); +gentextmodule('FontDemo', @demo); __DATA__