From e7670cf55a1731afad3fccfa102f8afd2e5a16e3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 5 Feb 2016 03:23:53 +0000 Subject: [PATCH] commitid.scad.pl: Generate 2D name inside gentextmodule; docs --- commitid.scad.pl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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__ -- 2.30.2