Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update old name in PyCSG doc #1009

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/source/addons/pycsg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ Example for usage:
# build solid union
union = CSG(cube1) + CSG(cylinder1)
# convert to mesh and render mesh to modelspace
union.mesh().render(msp, dxfattribs={'color': 1})
union.mesh().render_mesh(msp, dxfattribs={'color': 1})

# build solid difference
difference = CSG(cube1) - CSG(cylinder1)
# convert to mesh, translate mesh and render mesh to modelspace
difference.mesh().translate(1.5).render(msp, dxfattribs={'color': 3})
difference.mesh().translate(1.5).render_mesh(msp, dxfattribs={'color': 3})

# build solid intersection
intersection = CSG(cube1) * CSG(cylinder1)
# convert to mesh, translate mesh and render mesh to modelspace
intersection.mesh().translate(2.75).render(msp, dxfattribs={'color': 5})
intersection.mesh().translate(2.75).render_mesh(msp, dxfattribs={'color': 5})

doc.saveas('csg.dxf')

Expand Down Expand Up @@ -90,13 +90,13 @@ argument `quads` to ``True``.
sphere1 = sphere(count=32, stacks=16, radius=.5, quads=True)

union = (CSG(cube1) + CSG(sphere1)).mesh()
union.render(msp, dxfattribs={'color': 1})
union.render_mesh(msp, dxfattribs={'color': 1})

subtract = (CSG(cube1) - CSG(sphere1)).mesh().translate(2.5)
subtract.render(msp, dxfattribs={'color': 3})
subtract.render_mesh(msp, dxfattribs={'color': 3})

intersection = (CSG(cube1) * CSG(sphere1)).mesh().translate(4)
intersection.render(msp, dxfattribs={'color': 5})
intersection.render_mesh(msp, dxfattribs={'color': 5})

.. image:: gfx/pycsg02.png
:alt: Cube vs Sphere
Expand Down Expand Up @@ -127,8 +127,8 @@ Required runtime on an old Xeon E5-1620 Workstation @ 3.60GHz, with default recu

subtract = (CSG(sponge1, meshid=1) - CSG(sphere1, meshid=2))
# get mesh result by id
subtract.mesh(1).render(msp, dxfattribs={'layer': 'sponge'})
subtract.mesh(2).render(msp, dxfattribs={'layer': 'sphere'})
subtract.mesh(1).render_mesh(msp, dxfattribs={'layer': 'sponge'})
subtract.mesh(2).render_mesh(msp, dxfattribs={'layer': 'sphere'})

.. image:: gfx/menger_sponge_vs_sphere_level_3.png
:alt: Menger Sponge vs Sphere
Expand Down Expand Up @@ -177,4 +177,4 @@ License
.. _csg.js: https://github.com/evanw/csg.js
.. _pycsg: https://github.com/timknip/pycsg
.. _BSP tree: https://en.wikipedia.org/wiki/Binary_space_partitioning
.. _quadrilaterals: https://en.wikipedia.org/wiki/Quadrilateral
.. _quadrilaterals: https://en.wikipedia.org/wiki/Quadrilateral