From 7f48395e2d8113106a61ee5df6de3e024d9a9c55 Mon Sep 17 00:00:00 2001 From: hu-xiaonan <152783907+hu-xiaonan@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:08:01 +0800 Subject: [PATCH] Update old name in pycsg.rst --- docs/source/addons/pycsg.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/source/addons/pycsg.rst b/docs/source/addons/pycsg.rst index 353cd71cb..556331750 100644 --- a/docs/source/addons/pycsg.rst +++ b/docs/source/addons/pycsg.rst @@ -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') @@ -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 @@ -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 @@ -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 \ No newline at end of file +.. _quadrilaterals: https://en.wikipedia.org/wiki/Quadrilateral