mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Added Toy Truck example
This commit is contained in:
parent
70772be02b
commit
bf6206377d
5 changed files with 34 additions and 3 deletions
BIN
docs/assets/examples/toy_truck.png
Normal file
BIN
docs/assets/examples/toy_truck.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
BIN
docs/assets/examples/toy_truck_picture.jpg
Normal file
BIN
docs/assets/examples/toy_truck_picture.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 524 KiB |
|
|
@ -94,6 +94,11 @@ Most of the examples show the builder and algebra modes.
|
|||
:link: tea_cup
|
||||
:link-type: ref
|
||||
|
||||
.. grid-item-card:: Toy Truck |Builder|
|
||||
:img-top: assets/examples/toy_truck.png
|
||||
:link: toy_truck
|
||||
:link-type: ref
|
||||
|
||||
.. grid-item-card:: Vase |Builder| |Algebra|
|
||||
:img-top: assets/examples/vase.png
|
||||
:link: vase
|
||||
|
|
@ -515,6 +520,30 @@ The tea cup model involves several CAD techniques, such as:
|
|||
round the edges for aesthetic improvement and to mimic real-world objects more
|
||||
closely.
|
||||
|
||||
|
||||
.. _toy_truck:
|
||||
|
||||
Toy Truck
|
||||
---------
|
||||
.. image:: assets/examples/toy_truck.png
|
||||
:align: center
|
||||
|
||||
.. image:: assets/examples/toy_truck_picture.jpg
|
||||
:align: center
|
||||
|
||||
.. dropdown:: |Builder| Reference Implementation (Builder Mode)
|
||||
|
||||
.. literalinclude:: ../examples/toy_truck.py
|
||||
:start-after: [Code]
|
||||
:end-before: [End]
|
||||
|
||||
This example demonstrates how to design a toy truck using BuildPart and
|
||||
BuildSketch in Builder mode. The model includes a detailed body, cab, grill,
|
||||
and bumper, showcasing techniques like sketch reuse, symmetry, tapered
|
||||
extrusions, selective filleting, and the use of joints for part assembly.
|
||||
Ideal for learning complex part construction and hierarchical modeling in
|
||||
build123d.
|
||||
|
||||
.. _vase:
|
||||
|
||||
Vase
|
||||
|
|
|
|||
|
|
@ -66,8 +66,10 @@ def shape_to_html(shape: Any) -> HTML:
|
|||
)
|
||||
|
||||
# A new div with a unique id, plus the JS code templated with the id
|
||||
div_id = 'shape-' + uuid.uuid4().hex[:8]
|
||||
code = Template(TEMPLATE_JS).substitute(data=dumps(payload), div_id=div_id, ratio=0.5)
|
||||
div_id = "shape-" + uuid.uuid4().hex[:8]
|
||||
code = Template(TEMPLATE_JS).substitute(
|
||||
data=dumps(payload), div_id=div_id, ratio=0.5
|
||||
)
|
||||
html = HTML(f"<div id={div_id}></div><script>{code}</script>")
|
||||
|
||||
return html
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ name: __init__.py
|
|||
by: Gumyr
|
||||
date: January 07, 2025
|
||||
|
||||
desc:
|
||||
desc:
|
||||
This package contains modules for representing and manipulating 3D geometric shapes,
|
||||
including operations on vertices, edges, faces, solids, and composites.
|
||||
The package provides foundational classes to work with 3D objects, and methods to
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue