Replies: 1 comment
-
Ah... I just found an external page that has some info: https://www.billiam.org/2022/11/20/center-text-in-cascade-studio Which links back to this discussion: #86 (comment) ... sorry. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
`let PanelX=Slider("Width",80,20,200);
let PanelY=Slider("Height",20,20,200);
let PanelZ=Slider("Thickness",5,0.5,10);
let holes=Checkbox("Mount holes",true);
let holeRadius = Slider("Hole Radius", 0.5 , 0.1 , 5);
let holeOffset=Slider("Hole Offset",5, 1,10);
let panel=Box(PanelX,PanelY,PanelZ,false);
if (holes)
{
let h1=Translate([PanelX-holeOffset,holeOffset,-1],Cylinder(holeRadius,PanelZ+2,false));
let h2=Translate([PanelX-holeOffset,PanelY-holeOffset,-1],Cylinder(holeRadius,PanelZ+2,false));
let h3=Translate([holeOffset,PanelY-holeOffset,-1],Cylinder(holeRadius,PanelZ+2,false));
let h4=Translate([holeOffset,holeOffset,-1],Cylinder(holeRadius,PanelZ+2,false));
let basebody=Difference(panel,[h1,h2,h3,h4]);
let body=ChamferEdges(basebody,2,[0,2,5,14],false);
let textsize=Slider("Size",5,1,50);
let id=Rotate([1,0,0],-90,Text3D(TextInput("Text","HELLO",false),textsize));
// There doesn't seem to be a way to find the extent of the text so you can only guess at centering :()
Translate([PanelX/2-textsize,PanelY/2-textsize/4,PanelZ],id);
}
`
So this is sort of borked because you really don't know the X/Y extent of the text. I think the set size might be the X and the 2nd parameter is the Z (?) but the Y is unknown as far as I can tell.
Looking at methods/fields of id doesn't do much. There is Location, but I can't make any sense of the members of Location either. What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions