mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
assemblies.rst -> Fix use of non-existent Compound.import_step and don't use deprecated Shape.export_step
This commit is contained in:
parent
6d83cc167a
commit
269451b890
1 changed files with 4 additions and 4 deletions
|
|
@ -100,24 +100,24 @@ Consider this example where 100 screws are added to an assembly:
|
|||
|
||||
.. code::
|
||||
|
||||
screw = Compound.import_step("M6-1x12-countersunk-screw.step")
|
||||
screw = import_step("M6-1x12-countersunk-screw.step")
|
||||
locs = HexLocations(6, 10, 10).local_locations
|
||||
|
||||
screw_copies = [copy.deepcopy(screw).locate(loc) for loc in locs]
|
||||
copy_assembly = Compound(children=screw_copies)
|
||||
copy_assembly.export_step("copy_assembly.step")
|
||||
export_step(copy_assembly, "copy_assembly.step")
|
||||
|
||||
which takes about 5 seconds to run (on an older computer) and produces
|
||||
a file of size 51938 KB. However, if a shallow copy is used instead:
|
||||
|
||||
.. code::
|
||||
|
||||
screw = Compound.import_step("M6-1x12-countersunk-screw.step")
|
||||
screw = import_step("M6-1x12-countersunk-screw.step")
|
||||
locs = HexLocations(6, 10, 10).local_locations
|
||||
|
||||
screw_references = [copy.copy(screw).locate(loc) for loc in locs]
|
||||
reference_assembly = Compound(children=screw_references)
|
||||
reference_assembly.export_step("reference_assembly.step")
|
||||
export_step(reference_assembly, "reference_assembly.step")
|
||||
|
||||
this takes about ¼ second and produces a file of size 550 KB - just over
|
||||
1% of the size of the ``deepcopy()`` version and only 12% larger than the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue