mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Removing legacy reference
This commit is contained in:
parent
23d2025d72
commit
5027dac7bc
3 changed files with 85 additions and 23 deletions
51
docs/boxes_on_faces.svg
Normal file
51
docs/boxes_on_faces.svg
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="250.0"
|
||||||
|
height="250.0"
|
||||||
|
|
||||||
|
>
|
||||||
|
<g transform="scale(38.27327723098715, -38.27327723098715) translate(2.90515706125026,-3.2333264604737955)" stroke-width="0.02612789058968724" fill="none">
|
||||||
|
<!-- hidden lines -->
|
||||||
|
<g stroke="rgb(160,160,160)" fill="none" stroke-dasharray="0.02612789058968724,0.02612789058968724" >
|
||||||
|
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- solid lines -->
|
||||||
|
<g stroke="rgb(0,0,0)" fill="none">
|
||||||
|
<path d="M-2.121320343559643,-1.2247448713915892 L-2.121320343559643,1.2247448713915892 " />
|
||||||
|
<path d="M0.0,2.4494897427831783 L-2.121320343559643,1.224744871391589 " />
|
||||||
|
<path d="M2.121320343559643,-1.224744871391589 L0.0,-2.4494897427831783 " />
|
||||||
|
<path d="M-2.121320343559643,-1.2247448713915892 L0.0,-2.4494897427831788 " />
|
||||||
|
<path d="M-2.121320343559643,1.224744871391589 L0.0,-4.440892098500626e-16 " />
|
||||||
|
<path d="M0.0,-2.4494897427831783 L0.0,0.0 " />
|
||||||
|
<path d="M-0.3106601717798213,-1.334060272182827 L-1.3106601717798214,0.3979905353860509 " />
|
||||||
|
<path d="M0.0,2.4494897427831783 L2.121320343559643,1.224744871391589 " />
|
||||||
|
<path d="M2.121320343559643,-1.224744871391589 L2.121320343559643,1.2247448713915894 " />
|
||||||
|
<path d="M2.121320343559643,1.2247448713915892 L0.0,-2.220446049250313e-16 " />
|
||||||
|
<path d="M-1.0,0.9360697367967762 L0.9999999999999999,0.9360697367967762 " />
|
||||||
|
<path d="M0.31066017177982114,-0.7567100029932011 L0.8106601717798214,0.10931540079123786 " />
|
||||||
|
<path d="M-0.3106601717798213,-1.334060272182827 L-0.34601551083914867,-1.3544726867060202 " />
|
||||||
|
<path d="M-0.8460155108391487,-1.643147821300833 L-0.3460155108391486,-1.3544726867060202 " />
|
||||||
|
<path d="M-0.3460155108391487,-1.35447268670602 L-1.3460155108391487,0.3775781208628579 " />
|
||||||
|
<path d="M-1.3106601717798214,0.39799053538605045 L-1.3460155108391487,0.37757812086285736 " />
|
||||||
|
<path d="M-1.8460155108391487,0.08890298626804449 L-1.3460155108391487,0.3775781208628574 " />
|
||||||
|
<path d="M-0.8460155108391487,-1.643147821300833 L-1.8460155108391487,0.08890298626804483 " />
|
||||||
|
<path d="M-1.0,0.9360697367967765 L-1.0,0.9768945658431627 " />
|
||||||
|
<path d="M-1.0,1.5542448350327884 L-1.0,0.9768945658431626 " />
|
||||||
|
<path d="M-1.0,0.9768945658431627 L1.0,0.9768945658431627 " />
|
||||||
|
<path d="M1.0,0.9360697367967763 L1.0,0.9768945658431626 " />
|
||||||
|
<path d="M1.0,1.5542448350327884 L0.9999999999999999,0.9768945658431626 " />
|
||||||
|
<path d="M-1.0,1.5542448350327884 L1.0,1.5542448350327884 " />
|
||||||
|
<path d="M0.3106601717798213,-0.756710002993201 L0.34601551083914867,-0.7771224175163941 " />
|
||||||
|
<path d="M0.8460155108391487,0.08890298626804458 L0.3460155108391485,-0.7771224175163943 " />
|
||||||
|
<path d="M0.8106601717798213,0.1093154007912377 L0.8460155108391487,0.08890298626804455 " />
|
||||||
|
<path d="M0.3460155108391487,-0.7771224175163942 L1.346015510839149,-1.3544726867060202 " />
|
||||||
|
<path d="M1.8460155108391487,-0.4884472829215814 L1.3460155108391485,-1.3544726867060204 " />
|
||||||
|
<path d="M0.8460155108391487,0.08890298626804458 L1.846015510839149,-0.48844728292158135 " />
|
||||||
|
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 3.1 KiB |
|
|
@ -74,6 +74,24 @@ respect to this plane so the user only has to work with local coordinates.
|
||||||
Workplanes can be created from faces as well. The `top` sketch is positioned on top
|
Workplanes can be created from faces as well. The `top` sketch is positioned on top
|
||||||
of `example` by selecting its faces and finding the one with the greatest z value.
|
of `example` by selecting its faces and finding the one with the greatest z value.
|
||||||
|
|
||||||
|
One is not limited to a single workplane at a time. In the following example all six
|
||||||
|
faces of the first box is used to define workplanes which are then used to position
|
||||||
|
rotated boxes.
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
import build123d as bd
|
||||||
|
|
||||||
|
with bd.BuildPart() as bp:
|
||||||
|
bd.Box(3, 3, 3)
|
||||||
|
with bd.Workplanes(*bp.faces()):
|
||||||
|
bd.Box(1, 2, 0.1, rotation=(0, 0, 45))
|
||||||
|
|
||||||
|
This is the result:
|
||||||
|
|
||||||
|
.. image:: boxes_on_faces.svg
|
||||||
|
:align: center
|
||||||
|
|
||||||
A detailed description of `Workplanes` follows:
|
A detailed description of `Workplanes` follows:
|
||||||
|
|
||||||
.. py:module:: build_common
|
.. py:module:: build_common
|
||||||
|
|
@ -291,26 +309,3 @@ sorts and filters. Here is an example of a custom filters:
|
||||||
and -overall_width / 2 < v.X < overall_width / 2,
|
and -overall_width / 2 < v.X < overall_width / 2,
|
||||||
din.vertices(),
|
din.vertices(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
*************************************
|
|
||||||
Multiple Work Planes - BuildPart Only
|
|
||||||
*************************************
|
|
||||||
|
|
||||||
When `BuildPart` is invoked it will by default select the XY plane for the user to work on.
|
|
||||||
One can work on any plane by overriding this `workplane` parameter. The `workplane` can be changed
|
|
||||||
at any time to one or more planes which is most commonly used to create workplanes from
|
|
||||||
existing object Faces. The `WorkplanesFromFaces` class is used to do this as shown below:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
with BuildPart() as pipes:
|
|
||||||
Box(10, 10, 10, rotation=(10, 20, 30))
|
|
||||||
WorkplanesFromFaces(*pipes.faces(), replace=True)
|
|
||||||
with BuildSketch() as pipe:
|
|
||||||
Circle(4)
|
|
||||||
Extrude(-5, mode=Mode.SUBTRACTION)
|
|
||||||
|
|
||||||
In this example a `Box` is created and workplanes are created from each of the box's faces.
|
|
||||||
The following sketch is then created on each of these workplanes and the `Extrude` operation
|
|
||||||
creates holes in each of the faces of the box.
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,25 @@
|
||||||
import build123d as bd
|
import build123d as bd
|
||||||
|
from cadquery import exporters
|
||||||
|
|
||||||
with bd.BuildPart() as bp:
|
with bd.BuildPart() as bp:
|
||||||
bd.Box(3, 3, 3)
|
bd.Box(3, 3, 3)
|
||||||
with bd.Workplanes(*bp.faces()):
|
with bd.Workplanes(*bp.faces()):
|
||||||
bd.Box(1, 2, 0.1, rotation=(0, 0, 45))
|
bd.Box(1, 2, 0.1, rotation=(0, 0, 45))
|
||||||
|
|
||||||
|
# exporters.export(
|
||||||
|
# bp.part,
|
||||||
|
# "boxes_on_faces.svg",
|
||||||
|
# opt={
|
||||||
|
# "width": 250,
|
||||||
|
# "height": 250,
|
||||||
|
# "marginLeft": 30,
|
||||||
|
# "marginTop": 30,
|
||||||
|
# "showAxes": False,
|
||||||
|
# "projectionDir": (1, 1, 1),
|
||||||
|
# # "strokeWidth": 0.1,
|
||||||
|
# "showHidden": False,
|
||||||
|
# },
|
||||||
|
# )
|
||||||
|
|
||||||
if "show_object" in locals():
|
if "show_object" in locals():
|
||||||
show_object(bp.part, name="box on faces")
|
show_object(bp.part, name="box on faces")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue