discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

[suggestion] measurement widget

MC
Mr C Camacho
Wed, Apr 12, 2017 9:40 AM

something like

measure(extent=[100,100,0],major=10,minor=2)

you'd include this along with an object's transformations or on its own
with its own transformations.
(so it need not end up axis aligned)

Sometimes you might have features from an extruded SVG or two objects
with their own differently derived transformation that you just need to
double check distances, often the axis measure is not near by or even
obscured.

This would be best as a design only tool, which would be ignored during
STL export.

yes I could create some kind of stand in object but that would never be
as good as those axis lines as you are always subject to view scale...

before diving into the code, I thought I'd canvas peoples views, would
this be a waste of time or something that could be useful ?

something like measure(extent=[100,100,0],major=10,minor=2) you'd include this along with an object's transformations or on its own with its own transformations. (so it need not end up axis aligned) Sometimes you might have features from an extruded SVG or two objects with their own differently derived transformation that you just need to double check distances, often the axis measure is not near by or even obscured. This would be best as a design only tool, which would be ignored during STL export. yes I could create some kind of stand in object but that would never be as good as those axis lines as you are always subject to view scale... before diving into the code, I thought I'd canvas peoples views, would this be a waste of time or something that could be useful ?
RP
Ronaldo Persiano
Mon, Apr 17, 2017 1:36 AM

Chris,

I don't think this is worth to be included as a built in module. It is easy
to code in OpenSCAD language to fit our needs. That is my version that will
vanish on render mode:

module rule(s,dir=[1,0,0],c1=[1,0.5,0.5],c2=[0,0,1]) {
l = floor(s);
r_to(dir)
scale(1/l)
for(i=[0:l-1]) {
colour(i,c1,c2) %
if(i==0)
translate([l,0,0]) rotate([0,-90,0]) tip(l);
else if(i==l-1) // the last tip may longer than 1
translate([il,0,0]) rotate([0,90,0]) tip(l(1+s-l));
else if(!i%10 && i!=0) translate([i*l,0,0])
translate([l-l/4,0,-l/8]) linear_extrude(height=l/4)
rotate(90) text(str(i),halign="center",size=l/2);
else
translate([(i+0.5)*l,0,0]) cube([l,l/2,l/2],center=true);
}
module tip(s)
linear_extrude(height=s, scale=0.01) square(l/2,center=true);
module colour(i,c1,c2)
if(i%2) color(c2) children();
else    color(c1) children();
module r_to(d) // rotate_from_to
if(norm(d)<1e-16) rotate([0,-90,0]) children();
else mirror(d/norm(d)+[1,0,0]) mirror([1,0,0]) children();
}

rotate([30,70,15])
{
rule(10*sqrt(3),dir=[1,1,1]);
%cube(10);
}

2017-04-12 6:40 GMT-03:00 Mr C Camacho chris@bedroomcoders.co.uk:

something like

measure(extent=[100,100,0],major=10,minor=2)

you'd include this along with an object's transformations or on its own
with its own transformations.
(so it need not end up axis aligned)

Sometimes you might have features from an extruded SVG or two objects with
their own differently derived transformation that you just need to double
check distances, often the axis measure is not near by or even obscured.

This would be best as a design only tool, which would be ignored during
STL export.

yes I could create some kind of stand in object but that would never be as
good as those axis lines as you are always subject to view scale...

before diving into the code, I thought I'd canvas peoples views, would
this be a waste of time or something that could be useful ?


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Chris, I don't think this is worth to be included as a built in module. It is easy to code in OpenSCAD language to fit our needs. That is my version that will vanish on render mode: module rule(s,dir=[1,0,0],c1=[1,0.5,0.5],c2=[0,0,1]) { l = floor(s); r_to(dir) scale(1/l) for(i=[0:l-1]) { colour(i,c1,c2) % if(i==0) translate([l,0,0]) rotate([0,-90,0]) tip(l); else if(i==l-1) // the last tip may longer than 1 translate([i*l,0,0]) rotate([0,90,0]) tip(l*(1+s-l)); else if(!i%10 && i!=0) translate([i*l,0,0]) translate([l-l/4,0,-l/8]) linear_extrude(height=l/4) rotate(90) text(str(i),halign="center",size=l/2); else translate([(i+0.5)*l,0,0]) cube([l,l/2,l/2],center=true); } module tip(s) linear_extrude(height=s, scale=0.01) square(l/2,center=true); module colour(i,c1,c2) if(i%2) color(c2) children(); else color(c1) children(); module r_to(d) // rotate_from_to if(norm(d)<1e-16) rotate([0,-90,0]) children(); else mirror(d/norm(d)+[1,0,0]) mirror([1,0,0]) children(); } rotate([30,70,15]) { rule(10*sqrt(3),dir=[1,1,1]); %cube(10); } 2017-04-12 6:40 GMT-03:00 Mr C Camacho <chris@bedroomcoders.co.uk>: > something like > > measure(extent=[100,100,0],major=10,minor=2) > > you'd include this along with an object's transformations or on its own > with its own transformations. > (so it need not end up axis aligned) > > Sometimes you might have features from an extruded SVG or two objects with > their own differently derived transformation that you just need to double > check distances, often the axis measure is not near by or even obscured. > > This would be best as a design only tool, which would be ignored during > STL export. > > yes I could create some kind of stand in object but that would never be as > good as those axis lines as you are always subject to view scale... > > before diving into the code, I thought I'd canvas peoples views, would > this be a waste of time or something that could be useful ? > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >