From 3328a996eed731e04d8359c49d018185c9271e90 Mon Sep 17 00:00:00 2001 From: maride Date: Mon, 27 Nov 2017 01:30:58 +0100 Subject: [PATCH] Increase performance with pre-calculated values --- Logo_maride.scad | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Logo_maride.scad b/Logo_maride.scad index 63f8e2e..26d4f9f 100644 --- a/Logo_maride.scad +++ b/Logo_maride.scad @@ -1,12 +1,16 @@ LETTER_WIDTH=10; LETTER_HEIGHT=30; +LETTER_HEIGHT_13=LETTER_HEIGHT/3; +LETTER_HEIGHT_23=LETTER_HEIGHT*2/3; +LETTER_HEIGHT_12=LETTER_HEIGHT/2; + // m -polygon(points=[[0,LETTER_HEIGHT*2/3], [0, LETTER_HEIGHT/3], [LETTER_WIDTH, LETTER_HEIGHT*2/3], [LETTER_WIDTH, LETTER_HEIGHT]]); +polygon(points=[[0,LETTER_HEIGHT_23], [0, LETTER_HEIGHT_13], [LETTER_WIDTH, LETTER_HEIGHT_23], [LETTER_WIDTH, LETTER_HEIGHT]]); translate([LETTER_WIDTH*2, 0]) -polygon(points=[[0,LETTER_HEIGHT*2/3], [0, LETTER_HEIGHT/3], [LETTER_WIDTH/2, LETTER_HEIGHT*2/3], [LETTER_WIDTH/2, LETTER_HEIGHT]]); +polygon(points=[[0,LETTER_HEIGHT_23], [0, LETTER_HEIGHT/3], [LETTER_WIDTH/2, LETTER_HEIGHT_23], [LETTER_WIDTH/2, LETTER_HEIGHT]]); translate([LETTER_WIDTH*3.5, 0]) -polygon(points=[[0,LETTER_HEIGHT*2/3], [0, LETTER_HEIGHT/3], [LETTER_WIDTH/2, LETTER_HEIGHT*2/3], [LETTER_WIDTH/2, LETTER_HEIGHT]]); +polygon(points=[[0,LETTER_HEIGHT_23], [0, LETTER_HEIGHT/3], [LETTER_WIDTH/2, LETTER_HEIGHT_23], [LETTER_WIDTH/2, LETTER_HEIGHT]]); translate([LETTER_WIDTH, 0]) square([LETTER_WIDTH, LETTER_HEIGHT]);