mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Replaced text Halign/Valign with Align
This commit is contained in:
parent
2f38545f76
commit
d36b120206
14 changed files with 65 additions and 115 deletions
|
|
@ -27,17 +27,22 @@ license:
|
|||
from build123d import *
|
||||
|
||||
with BuildSketch() as logo_text:
|
||||
Text("123d", fontsize=10, valign=Valign.BOTTOM)
|
||||
Text("123d", fontsize=10, align=(Align.MIN, Align.MIN))
|
||||
font_height = logo_text.vertices().sort_by(Axis.Y)[-1].Y
|
||||
|
||||
with BuildSketch() as build_text:
|
||||
Text("build", fontsize=5, halign=Halign.CENTER)
|
||||
Text("build", fontsize=5, align=(Align.CENTER, Align.CENTER))
|
||||
build_bb = BoundingBox(build_text.sketch, mode=Mode.PRIVATE)
|
||||
build_vertices = build_bb.vertices().sort_by(Axis.X)
|
||||
build_width = build_vertices[-1].X - build_vertices[0].X
|
||||
|
||||
with BuildSketch() as cust_text:
|
||||
Text("customizable", fontsize=2.9, halign=Halign.CENTER, font_style=FontStyle.BOLD)
|
||||
Text(
|
||||
"customizable",
|
||||
fontsize=2.9,
|
||||
align=(Align.CENTER, Align.CENTER),
|
||||
font_style=FontStyle.BOLD,
|
||||
)
|
||||
cust_bb = BoundingBox(cust_text.sketch, mode=Mode.PRIVATE)
|
||||
cust_vertices = cust_text.vertices().sort_by(Axis.X)
|
||||
cust_width = cust_vertices[-1].X - cust_vertices[0].X
|
||||
|
|
@ -48,12 +53,12 @@ with BuildLine() as one:
|
|||
|
||||
with BuildSketch() as two:
|
||||
with Locations((font_height * 0.35, 0)):
|
||||
Text("2", fontsize=10, valign=Valign.BOTTOM)
|
||||
Text("2", fontsize=10, align=(Align.MIN, Align.MIN))
|
||||
|
||||
with BuildPart() as three_d:
|
||||
with Locations((font_height * 1.1, 0)):
|
||||
with BuildSketch():
|
||||
Text("3d", fontsize=10, valign=Valign.BOTTOM)
|
||||
Text("3d", fontsize=10, align=(Align.MIN, Align.MIN))
|
||||
Extrude(amount=font_height * 0.3)
|
||||
logo_width = three_d.vertices().sort_by(Axis.X)[-1].X
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue