Skip to content

Commit

Permalink
Update old name in pycsg.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
hu-xiaonan authored Jan 17, 2024
1 parent 7d302c0 commit 7f48395
Showing 1 changed file with 9 additions and 9 deletions.
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

0 comments on commit 7f48395

Please sign in to comment.