mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-09 17:06:34 +02:00
removed center from experiment
This commit is contained in:
@@ -25,7 +25,7 @@ include <../utils/maths.scad>
|
|||||||
//if text is empty, will display the number value
|
//if text is empty, will display the number value
|
||||||
//thickness will determine the thickness of the lines, and size of the arrows, if 0, will use 0.5% of the length of the dim
|
//thickness will determine the thickness of the lines, and size of the arrows, if 0, will use 0.5% of the length of the dim
|
||||||
//text_size will determine the size of the text, if 0, will use percentage of the length of the dim
|
//text_size will determine the size of the text, if 0, will use percentage of the length of the dim
|
||||||
module dimension(startpoint, endpoint, text = "", thickness = 0, text_size = 0 , rot_around_dim=0, text_centered=true) {
|
module dimension(startpoint, endpoint, text = "", thickness = 0, text_size = 0 , rot_around_dim=0) {
|
||||||
// Compute vector between points
|
// Compute vector between points
|
||||||
direction = endpoint - startpoint;
|
direction = endpoint - startpoint;
|
||||||
length = norm(direction);
|
length = norm(direction);
|
||||||
@@ -75,7 +75,7 @@ module dimension(startpoint, endpoint, text = "", thickness = 0, text_size = 0 ,
|
|||||||
rotate([rot_around_dim,0,0])
|
rotate([rot_around_dim,0,0])
|
||||||
translate([0,thickness,-thickness/2])
|
translate([0,thickness,-thickness/2])
|
||||||
linear_extrude(thickness)
|
linear_extrude(thickness)
|
||||||
text(text == "" ? str(length) : text, size = (text_size == 0? length/15:text_size), valign = (text_centered?"center":"bottom"), halign = "center");
|
text(text == "" ? str(length) : text, size = (text_size == 0? length/15:text_size), valign = "bottom", halign = "center");
|
||||||
}
|
}
|
||||||
|
|
||||||
//offset will detirmine how much space is between the measured point and the dimension
|
//offset will detirmine how much space is between the measured point and the dimension
|
||||||
|
Reference in New Issue
Block a user