Playing with Extruded Text

A very simple extruded text example:

length, width, thickness, fontsize = 200.0, 100.0, 10.0, 60

plane = Plane.XY
text2d = plane * Text("ne1?", font_size=fontsize, align=(Align.CENTER, Align.MIN))
text3d = extrude(text2d, amount=thickness)

save = text3d

Slightly more complicated:

# Create a sphere and a box centered at the origin
sphere = Sphere(radius=20)
box = Box(length=30, width=30, height=30)

# Perform a boolean intersection of the sphere and the box
body = sphere & box

planex = Plane.YZ
x2d = planex * Text("X", font_size=25, align=(Align.CENTER))
x3d = extrude(x2d, amount=100).translate((-30, 0, 0))

planey = Plane.XZ
y2d = planey * Text("Y", font_size=25, align=(Align.CENTER))
y3d = extrude(y2d, amount=100).translate((0, 30, 0))

planez = Plane.XY
z2d = planez * Text("Z", font_size=25, align=(Align.CENTER))
z3d = extrude(z2d, amount=100).translate((0, 0, -30))

# Subtract the cylinder assembly from the body
save = body - x3d - y3d- z3d

Perhaps neThing can have a copy/pasta repository for code with simple primitives at the ready for users to construct their model in the text editor

For example: Build123D code for a rectilinear volume that could ‘back’ the extruded text so that a solid BREP is returned, making it printable with the ‘Make It Real’ option

1 Like