pack(): introduced a new helper for packing parts into a 2D footprint.

Also added documentation for the new facility as well as a nascent
CONTRIBUTING.md to collect pointers to the tools used by developers of
this project.
This commit is contained in:
Ami Fischman 2023-11-09 13:19:01 -08:00
parent cdd00771f5
commit b767b78a69
8 changed files with 962 additions and 2 deletions

12
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,12 @@
When writing code for inclusion in build123d please add docs and
tests, ensure they build and pass, and ensure that `pylint` and `mypy`
are happy with your code.
- Install `pip` following their [documentation](https://pip.pypa.io/en/stable/installation/).
- Install development dependencies: `pip install pylint pytest mypy sphinx`
- Install docs dependencies: `pip install -r docs/requirements.txt` (might need to comment out the build123d line in that file)
- Install `build123d` in editable mode from current dir: `pip install -e .`
- Run tests with: `python -m pytest`
- Build docs with: `cd docs && make html`
- Check added files' style with: `pylint <path/to/file.py>`
- Check added files' type annotations with: `mypy <path/to/file.py>`

View file

@ -0,0 +1,113 @@
<?xml version='1.0' encoding='utf-8'?>
<svg width="100.09mm" height="98.074625mm" viewBox="-12.957705 -12.696793 25.91541 25.393587" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g transform="scale(1,-1)" stroke-linecap="round">
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.023302896428222534" id="Visible">
<line x1="5.41638" y1="-12.685142" x2="3.121076" y2="-11.694396" />
<line x1="-10.650749" y1="-5.749916" x2="-12.946054" y2="-4.75917" />
<line x1="3.121076" y1="-11.694396" x2="-10.650749" y2="-5.749916" />
<line x1="3.841048" y1="-12.549755" x2="4.039197" y2="-12.090694" />
<line x1="-11.76702" y1="-5.812679" x2="-11.568871" y2="-5.353618" />
<line x1="3.841048" y1="-12.549755" x2="-11.76702" y2="-5.812679" />
<line x1="5.41638" y1="-12.685142" x2="8.983067" y2="-4.422047" />
<line x1="8.983067" y1="-4.422047" x2="9.379366" y2="-3.503925" />
<line x1="9.379366" y1="-3.503925" x2="12.946054" y2="4.75917" />
<line x1="-12.946054" y1="-4.75917" x2="-9.379366" y2="3.503925" />
<line x1="-9.379366" y1="3.503925" x2="-8.983067" y2="4.422047" />
<line x1="-8.983067" y1="4.422047" x2="-5.41638" y2="12.685142" />
<line x1="-10.650749" y1="-5.749916" x2="-9.858152" y2="-3.913673" />
<line x1="8.002184" y1="-2.909477" x2="10.776274" y2="3.517374" />
<line x1="10.776274" y1="3.517374" x2="9.858152" y2="3.913673" />
<line x1="9.858152" y1="3.913673" x2="10.650749" y2="5.749916" />
<line x1="10.650749" y1="5.749916" x2="-3.121076" y2="11.694396" />
<line x1="-3.913673" y1="9.858152" x2="-3.121076" y2="11.694396" />
<line x1="-3.913673" y1="9.858152" x2="-4.831795" y2="10.254451" />
<line x1="-7.605885" y1="3.827599" x2="-4.831795" y2="10.254451" />
<line x1="-7.605885" y1="3.827599" x2="-8.983067" y2="4.422047" />
<line x1="-8.002184" y1="2.909477" x2="-9.379366" y2="3.503925" />
<line x1="-10.776274" y1="-3.517374" x2="-8.002184" y2="2.909477" />
<line x1="-9.858152" y1="-3.913673" x2="-10.776274" y2="-3.517374" />
<line x1="3.121076" y1="-11.694396" x2="3.913673" y2="-9.858152" />
<line x1="4.831795" y1="-10.254451" x2="3.913673" y2="-9.858152" />
<line x1="4.831795" y1="-10.254451" x2="7.605885" y2="-3.827599" />
<line x1="8.983067" y1="-4.422047" x2="7.605885" y2="-3.827599" />
<line x1="9.379366" y1="-3.503925" x2="8.002184" y2="-2.909477" />
<line x1="12.946054" y1="4.75917" x2="10.650749" y2="5.749916" />
<line x1="-3.121076" y1="11.694396" x2="-5.41638" y2="12.685142" />
<line x1="-4.039197" y1="12.090694" x2="-3.841048" y2="12.549755" />
<line x1="11.568871" y1="5.353618" x2="11.76702" y2="5.812679" />
<line x1="11.76702" y1="5.812679" x2="-3.841048" y2="12.549755" />
</g>
<g fill="none" stroke="rgb(99,99,99)" stroke-width="0.023302896428222534" id="Hidden" stroke-dasharray="0.000592 0.070205">
<line x1="4.039197" y1="-12.090694" x2="-11.568871" y2="-5.353618" />
<line x1="-11.568871" y1="-5.353618" x2="4.039197" y2="-12.090694" />
<line x1="5.41638" y1="-12.685142" x2="3.121076" y2="-11.694396" />
<line x1="3.121076" y1="-11.694396" x2="-10.650749" y2="-5.749916" />
<line x1="-10.650749" y1="-5.749916" x2="-12.946054" y2="-4.75917" />
<line x1="-11.76702" y1="-5.812679" x2="-11.568871" y2="-5.353618" />
<line x1="3.841048" y1="-12.549755" x2="-11.76702" y2="-5.812679" />
<line x1="3.841048" y1="-12.549755" x2="4.039197" y2="-12.090694" />
<line x1="3.913673" y1="-9.858152" x2="3.121076" y2="-11.694396" />
<line x1="4.831795" y1="-10.254451" x2="3.913673" y2="-9.858152" />
<line x1="4.831795" y1="-10.254451" x2="7.605885" y2="-3.827599" />
<line x1="7.605885" y1="-3.827599" x2="8.983067" y2="-4.422047" />
<line x1="5.41638" y1="-12.685142" x2="8.983067" y2="-4.422047" />
<line x1="9.379366" y1="-3.503925" x2="12.946054" y2="4.75917" />
<line x1="8.983067" y1="-4.422047" x2="9.379366" y2="-3.503925" />
<line x1="3.913673" y1="-9.858152" x2="4.831795" y2="-10.254451" />
<line x1="4.831795" y1="-10.254451" x2="7.605885" y2="-3.827599" />
<line x1="7.605885" y1="-3.827599" x2="8.983067" y2="-4.422047" />
<line x1="3.913673" y1="-9.858152" x2="3.121076" y2="-11.694396" />
<line x1="3.121076" y1="-11.694396" x2="3.913673" y2="-9.858152" />
<line x1="-10.650749" y1="-5.749916" x2="-9.858152" y2="-3.913673" />
<line x1="4.831795" y1="-10.254451" x2="3.913673" y2="-9.858152" />
<line x1="4.831795" y1="-10.254451" x2="7.605885" y2="-3.827599" />
<line x1="8.983067" y1="-4.422047" x2="7.605885" y2="-3.827599" />
<line x1="9.379366" y1="-3.503925" x2="8.002184" y2="-2.909477" />
<line x1="8.002184" y1="-2.909477" x2="10.776274" y2="3.517374" />
<line x1="10.776274" y1="3.517374" x2="9.858152" y2="3.913673" />
<line x1="9.858152" y1="3.913673" x2="10.650749" y2="5.749916" />
<line x1="10.650749" y1="5.749916" x2="-3.121076" y2="11.694396" />
<line x1="-3.913673" y1="9.858152" x2="-3.121076" y2="11.694396" />
<line x1="-3.913673" y1="9.858152" x2="-4.831795" y2="10.254451" />
<line x1="-7.605885" y1="3.827599" x2="-4.831795" y2="10.254451" />
<line x1="-7.605885" y1="3.827599" x2="-8.983067" y2="4.422047" />
<line x1="-9.379366" y1="3.503925" x2="-8.983067" y2="4.422047" />
<line x1="-8.002184" y1="2.909477" x2="-9.379366" y2="3.503925" />
<line x1="-10.776274" y1="-3.517374" x2="-8.002184" y2="2.909477" />
<line x1="-9.858152" y1="-3.913673" x2="-10.776274" y2="-3.517374" />
<line x1="-9.858152" y1="-3.913673" x2="-10.650749" y2="-5.749916" />
<line x1="-12.946054" y1="-4.75917" x2="-9.379366" y2="3.503925" />
<line x1="-9.379366" y1="3.503925" x2="-8.002184" y2="2.909477" />
<line x1="-10.776274" y1="-3.517374" x2="-8.002184" y2="2.909477" />
<line x1="-10.776274" y1="-3.517374" x2="-9.858152" y2="-3.913673" />
<line x1="-8.983067" y1="4.422047" x2="-5.41638" y2="12.685142" />
<line x1="-9.379366" y1="3.503925" x2="-8.002184" y2="2.909477" />
<line x1="-10.776274" y1="-3.517374" x2="-8.002184" y2="2.909477" />
<line x1="-9.858152" y1="-3.913673" x2="-10.776274" y2="-3.517374" />
<line x1="-9.858152" y1="-3.913673" x2="-10.650749" y2="-5.749916" />
<line x1="8.002184" y1="-2.909477" x2="9.379366" y2="-3.503925" />
<line x1="8.002184" y1="-2.909477" x2="10.776274" y2="3.517374" />
<line x1="9.858152" y1="3.913673" x2="10.776274" y2="3.517374" />
<line x1="10.650749" y1="5.749916" x2="9.858152" y2="3.913673" />
<line x1="12.946054" y1="4.75917" x2="10.650749" y2="5.749916" />
<line x1="-3.121076" y1="11.694396" x2="-5.41638" y2="12.685142" />
<line x1="11.568871" y1="5.353618" x2="-4.039197" y2="12.090694" />
<line x1="-4.039197" y1="12.090694" x2="11.568871" y2="5.353618" />
<line x1="8.002184" y1="-2.909477" x2="9.379366" y2="-3.503925" />
<line x1="8.002184" y1="-2.909477" x2="10.776274" y2="3.517374" />
<line x1="9.858152" y1="3.913673" x2="10.776274" y2="3.517374" />
<line x1="10.650749" y1="5.749916" x2="9.858152" y2="3.913673" />
<line x1="-3.121076" y1="11.694396" x2="-3.913673" y2="9.858152" />
<line x1="-4.831795" y1="10.254451" x2="-3.913673" y2="9.858152" />
<line x1="-7.605885" y1="3.827599" x2="-4.831795" y2="10.254451" />
<line x1="-8.983067" y1="4.422047" x2="-7.605885" y2="3.827599" />
<line x1="-8.983067" y1="4.422047" x2="-7.605885" y2="3.827599" />
<line x1="-3.121076" y1="11.694396" x2="-3.913673" y2="9.858152" />
<line x1="-4.831795" y1="10.254451" x2="-3.913673" y2="9.858152" />
<line x1="-7.605885" y1="3.827599" x2="-4.831795" y2="10.254451" />
<line x1="-4.039197" y1="12.090694" x2="-3.841048" y2="12.549755" />
<line x1="11.568871" y1="5.353618" x2="11.76702" y2="5.812679" />
<line x1="11.76702" y1="5.812679" x2="-3.841048" y2="12.549755" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8 KiB

View file

@ -0,0 +1,609 @@
<?xml version='1.0' encoding='utf-8'?>
<svg width="100.09mm" height="94.828286mm" viewBox="-75.158411 -79.079813 143.393259 135.8551" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g transform="scale(1,-1)" stroke-linecap="round">
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.12893788891198896" id="Visible">
<line x1="-5.693759" y1="67.888004" x2="-5.693759" y2="68.634199" />
<line x1="-5.693759" y1="68.634199" x2="-6.509998" y2="69.170199" />
<line x1="-6.509998" y1="68.424004" x2="-6.509998" y2="69.170199" />
<line x1="-5.693759" y1="67.888004" x2="-6.509998" y2="68.424004" />
<line x1="0.083391" y1="75.461001" x2="0.083391" y2="76.207196" />
<line x1="0.083391" y1="76.207196" x2="-0.732847" y2="76.743196" />
<line x1="-5.693759" y1="67.888004" x2="0.083391" y2="75.461001" />
<line x1="-5.693759" y1="68.634199" x2="0.083391" y2="76.207196" />
<line x1="-6.509998" y1="69.170199" x2="-0.732847" y2="76.743196" />
<line x1="43.105509" y1="48.532875" x2="43.105509" y2="48.905973" />
<line x1="43.105509" y1="48.905973" x2="40.656793" y2="50.513971" />
<line x1="40.656793" y1="50.140874" x2="40.656793" y2="50.513971" />
<line x1="43.105509" y1="48.532875" x2="40.656793" y2="50.140874" />
<line x1="43.683224" y1="49.290175" x2="43.683224" y2="49.663272" />
<line x1="43.683224" y1="49.663272" x2="41.234508" y2="51.271271" />
<line x1="43.105509" y1="48.532875" x2="43.683224" y2="49.290175" />
<line x1="43.105509" y1="48.905973" x2="43.683224" y2="49.663272" />
<line x1="40.656793" y1="50.513971" x2="41.234508" y2="51.271271" />
<line x1="-6.562586" y1="29.998376" x2="-6.562586" y2="30.371473" />
<line x1="-6.562586" y1="30.371473" x2="-7.378825" y2="30.907473" />
<line x1="-7.378825" y1="30.534375" x2="-7.378825" y2="30.907473" />
<line x1="-6.562586" y1="29.998376" x2="-7.378825" y2="30.534375" />
<line x1="-1.363151" y1="36.814073" x2="-1.363151" y2="37.18717" />
<line x1="-1.363151" y1="37.18717" x2="-2.179389" y2="37.72317" />
<line x1="-6.562586" y1="29.998376" x2="-1.363151" y2="36.814073" />
<line x1="-6.562586" y1="30.371473" x2="-1.363151" y2="37.18717" />
<line x1="-7.378825" y1="30.907473" x2="-2.179389" y2="37.72317" />
<line x1="8.945945" y1="19.627836" x2="8.945945" y2="20.374031" />
<line x1="8.945945" y1="20.374031" x2="-4.113871" y2="28.950023" />
<line x1="-4.113871" y1="28.203828" x2="-4.113871" y2="28.950023" />
<line x1="8.945945" y1="19.627836" x2="-4.113871" y2="28.203828" />
<line x1="13.567666" y1="25.686234" x2="13.567666" y2="26.432428" />
<line x1="13.567666" y1="26.432428" x2="0.50785" y2="35.008421" />
<line x1="8.945945" y1="19.627836" x2="13.567666" y2="25.686234" />
<line x1="8.945945" y1="20.374031" x2="13.567666" y2="26.432428" />
<line x1="-4.113871" y1="28.950023" x2="0.50785" y2="35.008421" />
<line x1="28.737006" y1="13.451644" x2="28.737006" y2="14.197839" />
<line x1="28.737006" y1="14.197839" x2="14.860951" y2="23.309831" />
<line x1="14.860951" y1="22.563636" x2="14.860951" y2="23.309831" />
<line x1="28.737006" y1="13.451644" x2="14.860951" y2="22.563636" />
<line x1="29.314721" y1="14.208944" x2="29.314721" y2="14.955139" />
<line x1="29.314721" y1="14.955139" x2="15.438666" y2="24.06713" />
<line x1="28.737006" y1="13.451644" x2="29.314721" y2="14.208944" />
<line x1="28.737006" y1="14.197839" x2="29.314721" y2="14.955139" />
<line x1="14.860951" y1="23.309831" x2="15.438666" y2="24.06713" />
<line x1="24.242248" y1="30.229782" x2="24.242248" y2="30.602879" />
<line x1="24.242248" y1="30.602879" x2="14.447386" y2="37.034874" />
<line x1="14.447386" y1="36.661776" x2="14.447386" y2="37.034874" />
<line x1="24.242248" y1="30.229782" x2="14.447386" y2="36.661776" />
<line x1="31.752544" y1="40.074678" x2="31.752544" y2="40.447775" />
<line x1="31.752544" y1="40.447775" x2="21.957682" y2="46.879769" />
<line x1="24.242248" y1="30.229782" x2="31.752544" y2="40.074678" />
<line x1="24.242248" y1="30.602879" x2="31.752544" y2="40.447775" />
<line x1="14.447386" y1="37.034874" x2="21.957682" y2="46.879769" />
<line x1="11.908895" y1="7.079047" x2="11.908895" y2="8.571436" />
<line x1="11.908895" y1="8.571436" x2="10.276418" y2="9.643436" />
<line x1="10.276418" y1="8.151046" x2="10.276418" y2="9.643436" />
<line x1="11.908895" y1="7.079047" x2="10.276418" y2="8.151046" />
<line x1="15.375185" y1="11.622845" x2="15.375185" y2="13.115235" />
<line x1="15.375185" y1="13.115235" x2="13.742708" y2="14.187234" />
<line x1="11.908895" y1="7.079047" x2="15.375185" y2="11.622845" />
<line x1="11.908895" y1="8.571436" x2="15.375185" y2="13.115235" />
<line x1="10.276418" y1="9.643436" x2="13.742708" y2="14.187234" />
<line x1="-16.134326" y1="-12.015848" x2="-16.134326" y2="-10.523458" />
<line x1="-16.134326" y1="-10.523458" x2="-28.377904" y2="-2.483465" />
<line x1="-28.377904" y1="-3.975855" x2="-28.377904" y2="-2.483465" />
<line x1="-16.134326" y1="-12.015848" x2="-28.377904" y2="-3.975855" />
<line x1="-6.31317" y1="0.858246" x2="-6.31317" y2="2.350636" />
<line x1="-6.31317" y1="2.350636" x2="-18.556748" y2="10.390629" />
<line x1="-16.134326" y1="-12.015848" x2="-6.31317" y2="0.858246" />
<line x1="-16.134326" y1="-10.523458" x2="-6.31317" y2="2.350636" />
<line x1="-28.377904" y1="-2.483465" x2="-18.556748" y2="10.390629" />
<line x1="-39.868724" y1="-7.983404" x2="-39.868724" y2="-6.117917" />
<line x1="-39.868724" y1="-6.117917" x2="-44.766155" y2="-2.90192" />
<line x1="-44.766155" y1="-4.767407" x2="-44.766155" y2="-2.90192" />
<line x1="-39.868724" y1="-7.983404" x2="-44.766155" y2="-4.767407" />
<line x1="-30.047568" y1="4.89069" x2="-30.047568" y2="6.756178" />
<line x1="-30.047568" y1="6.756178" x2="-34.944999" y2="9.972175" />
<line x1="-39.868724" y1="-7.983404" x2="-30.047568" y2="4.89069" />
<line x1="-39.868724" y1="-6.117917" x2="-30.047568" y2="6.756178" />
<line x1="-44.766155" y1="-2.90192" x2="-34.944999" y2="9.972175" />
<line x1="-6.063754" y1="-27.16259" x2="-6.063754" y2="-26.789493" />
<line x1="-6.063754" y1="-26.789493" x2="-7.696231" y2="-25.717494" />
<line x1="-7.696231" y1="-26.090591" x2="-7.696231" y2="-25.717494" />
<line x1="-6.063754" y1="-27.16259" x2="-7.696231" y2="-26.090591" />
<line x1="4.335117" y1="-13.531196" x2="4.335117" y2="-13.158099" />
<line x1="4.335117" y1="-13.158099" x2="2.70264" y2="-12.0861" />
<line x1="-6.063754" y1="-27.16259" x2="4.335117" y2="-13.531196" />
<line x1="-6.063754" y1="-26.789493" x2="4.335117" y2="-13.158099" />
<line x1="-7.696231" y1="-25.717494" x2="2.70264" y2="-12.0861" />
<line x1="15.300811" y1="27.398486" x2="15.300811" y2="29.263974" />
<line x1="15.300811" y1="29.263974" x2="12.035857" y2="31.407972" />
<line x1="12.035857" y1="29.542484" x2="12.035857" y2="31.407972" />
<line x1="15.300811" y1="27.398486" x2="12.035857" y2="29.542484" />
<line x1="17.033956" y1="29.670385" x2="17.033956" y2="31.535873" />
<line x1="17.033956" y1="31.535873" x2="13.769002" y2="33.679871" />
<line x1="15.300811" y1="27.398486" x2="17.033956" y2="29.670385" />
<line x1="15.300811" y1="29.263974" x2="17.033956" y2="31.535873" />
<line x1="12.035857" y1="31.407972" x2="13.769002" y2="33.679871" />
<line x1="7.827702" y1="10.132142" x2="7.827702" y2="10.878337" />
<line x1="7.827702" y1="10.878337" x2="5.378987" y2="12.486335" />
<line x1="5.378987" y1="11.74014" x2="5.378987" y2="12.486335" />
<line x1="7.827702" y1="10.132142" x2="5.378987" y2="11.74014" />
<line x1="9.560847" y1="12.404041" x2="9.560847" y2="13.150236" />
<line x1="9.560847" y1="13.150236" x2="7.112132" y2="14.758234" />
<line x1="7.827702" y1="10.132142" x2="9.560847" y2="12.404041" />
<line x1="7.827702" y1="10.878337" x2="9.560847" y2="13.150236" />
<line x1="5.378987" y1="12.486335" x2="7.112132" y2="14.758234" />
<line x1="28.308039" y1="-19.416585" x2="28.308039" y2="-18.297293" />
<line x1="28.308039" y1="-18.297293" x2="12.799507" y2="-8.113302" />
<line x1="12.799507" y1="-9.232595" x2="12.799507" y2="-8.113302" />
<line x1="28.308039" y1="-19.416585" x2="12.799507" y2="-9.232595" />
<line x1="34.662904" y1="-11.086289" x2="34.662904" y2="-9.966997" />
<line x1="34.662904" y1="-9.966997" x2="19.154373" y2="0.216994" />
<line x1="28.308039" y1="-19.416585" x2="34.662904" y2="-11.086289" />
<line x1="28.308039" y1="-18.297293" x2="34.662904" y2="-9.966997" />
<line x1="12.799507" y1="-8.113302" x2="19.154373" y2="0.216994" />
<line x1="41.595485" y1="-2.37179" x2="41.595485" y2="-0.506303" />
<line x1="41.595485" y1="-0.506303" x2="27.719431" y2="8.605689" />
<line x1="27.719431" y1="6.740201" x2="27.719431" y2="8.605689" />
<line x1="41.595485" y1="-2.37179" x2="27.719431" y2="6.740201" />
<line x1="50.261211" y1="8.987705" x2="50.261211" y2="10.853192" />
<line x1="50.261211" y1="10.853192" x2="36.385157" y2="19.965184" />
<line x1="41.595485" y1="-2.37179" x2="50.261211" y2="8.987705" />
<line x1="41.595485" y1="-0.506303" x2="50.261211" y2="10.853192" />
<line x1="27.719431" y1="8.605689" x2="36.385157" y2="19.965184" />
<line x1="48.99422" y1="31.789489" x2="48.99422" y2="32.908781" />
<line x1="48.99422" y1="32.908781" x2="39.199358" y2="39.340775" />
<line x1="39.199358" y1="38.221483" x2="39.199358" y2="39.340775" />
<line x1="48.99422" y1="31.789489" x2="39.199358" y2="38.221483" />
<line x1="55.349086" y1="40.119785" x2="55.349086" y2="41.239077" />
<line x1="55.349086" y1="41.239077" x2="45.554224" y2="47.671071" />
<line x1="48.99422" y1="31.789489" x2="55.349086" y2="40.119785" />
<line x1="48.99422" y1="32.908781" x2="55.349086" y2="41.239077" />
<line x1="39.199358" y1="39.340775" x2="45.554224" y2="47.671071" />
<line x1="-4.580025" y1="3.316694" x2="-4.580025" y2="4.435987" />
<line x1="-4.580025" y1="4.435987" x2="-7.844979" y2="6.579985" />
<line x1="-7.844979" y1="5.460692" x2="-7.844979" y2="6.579985" />
<line x1="-4.580025" y1="3.316694" x2="-7.844979" y2="5.460692" />
<line x1="0.041696" y1="9.375092" x2="0.041696" y2="10.494384" />
<line x1="0.041696" y1="10.494384" x2="-3.223258" y2="12.638382" />
<line x1="-4.580025" y1="3.316694" x2="0.041696" y2="9.375092" />
<line x1="-4.580025" y1="4.435987" x2="0.041696" y2="10.494384" />
<line x1="-7.844979" y1="6.579985" x2="-3.223258" y2="12.638382" />
<line x1="-8.958713" y1="70.218551" x2="-8.958713" y2="70.591649" />
<line x1="-8.958713" y1="70.591649" x2="-11.407429" y2="72.199647" />
<line x1="-11.407429" y1="71.82655" x2="-11.407429" y2="72.199647" />
<line x1="-8.958713" y1="70.218551" x2="-11.407429" y2="71.82655" />
<line x1="-3.759278" y1="77.034248" x2="-3.759278" y2="77.407346" />
<line x1="-3.759278" y1="77.407346" x2="-6.207993" y2="79.015344" />
<line x1="-8.958713" y1="70.218551" x2="-3.759278" y2="77.034248" />
<line x1="-8.958713" y1="70.591649" x2="-3.759278" y2="77.407346" />
<line x1="-11.407429" y1="72.199647" x2="-6.207993" y2="79.015344" />
<line x1="10.350792" y1="-7.811145" x2="10.350792" y2="-6.318755" />
<line x1="10.350792" y1="-6.318755" x2="-1.892786" y2="1.721238" />
<line x1="-1.892786" y1="0.228848" x2="-1.892786" y2="1.721238" />
<line x1="10.350792" y1="-7.811145" x2="-1.892786" y2="0.228848" />
<line x1="14.394797" y1="-2.510047" x2="14.394797" y2="-1.017657" />
<line x1="14.394797" y1="-1.017657" x2="2.15122" y2="7.022335" />
<line x1="10.350792" y1="-7.811145" x2="14.394797" y2="-2.510047" />
<line x1="10.350792" y1="-6.318755" x2="14.394797" y2="-1.017657" />
<line x1="-1.892786" y1="1.721238" x2="2.15122" y2="7.022335" />
<line x1="-2.391618" y1="57.389814" x2="-2.391618" y2="58.882204" />
<line x1="-2.391618" y1="58.882204" x2="-3.207857" y2="59.418203" />
<line x1="-3.207857" y1="57.925813" x2="-3.207857" y2="59.418203" />
<line x1="-2.391618" y1="57.389814" x2="-3.207857" y2="57.925813" />
<line x1="-1.236188" y1="58.904413" x2="-1.236188" y2="60.396803" />
<line x1="-1.236188" y1="60.396803" x2="-2.052427" y2="60.932802" />
<line x1="-2.391618" y1="57.389814" x2="-1.236188" y2="58.904413" />
<line x1="-2.391618" y1="58.882204" x2="-1.236188" y2="60.396803" />
<line x1="-3.207857" y1="59.418203" x2="-2.052427" y2="60.932802" />
<line x1="38.118302" y1="21.11779" x2="38.118302" y2="21.490888" />
<line x1="38.118302" y1="21.490888" x2="26.690963" y2="28.994881" />
<line x1="26.690963" y1="28.621783" x2="26.690963" y2="28.994881" />
<line x1="38.118302" y1="21.11779" x2="26.690963" y2="28.621783" />
<line x1="40.429162" y1="24.146989" x2="40.429162" y2="24.520086" />
<line x1="40.429162" y1="24.520086" x2="29.001823" y2="32.02408" />
<line x1="38.118302" y1="21.11779" x2="40.429162" y2="24.146989" />
<line x1="38.118302" y1="21.490888" x2="40.429162" y2="24.520086" />
<line x1="26.690963" y1="28.994881" x2="29.001823" y2="32.02408" />
<line x1="2.203808" y1="44.51522" x2="2.203808" y2="45.261415" />
<line x1="2.203808" y1="45.261415" x2="-8.407292" y2="52.229409" />
<line x1="-8.407292" y1="51.483214" x2="-8.407292" y2="52.229409" />
<line x1="2.203808" y1="44.51522" x2="-8.407292" y2="51.483214" />
<line x1="5.670099" y1="49.059018" x2="5.670099" y2="49.805213" />
<line x1="5.670099" y1="49.805213" x2="-4.941002" y2="56.773207" />
<line x1="2.203808" y1="44.51522" x2="5.670099" y2="49.059018" />
<line x1="2.203808" y1="45.261415" x2="5.670099" y2="49.805213" />
<line x1="-8.407292" y1="52.229409" x2="-4.941002" y2="56.773207" />
<line x1="25.997178" y1="-22.818882" x2="25.997178" y2="-20.953394" />
<line x1="25.997178" y1="-20.953394" x2="9.672408" y2="-10.233404" />
<line x1="9.672408" y1="-12.098891" x2="9.672408" y2="-10.233404" />
<line x1="25.997178" y1="-22.818882" x2="9.672408" y2="-12.098891" />
<line x1="26.574893" y1="-22.061582" x2="26.574893" y2="-20.196094" />
<line x1="26.574893" y1="-20.196094" x2="10.250123" y2="-9.476104" />
<line x1="25.997178" y1="-22.818882" x2="26.574893" y2="-22.061582" />
<line x1="25.997178" y1="-20.953394" x2="26.574893" y2="-20.196094" />
<line x1="9.672408" y1="-10.233404" x2="10.250123" y2="-9.476104" />
<line x1="-28.314423" y1="7.162589" x2="-28.314423" y2="9.028077" />
<line x1="-28.314423" y1="9.028077" x2="-31.579377" y2="11.172075" />
<line x1="-31.579377" y1="9.306587" x2="-31.579377" y2="11.172075" />
<line x1="-28.314423" y1="7.162589" x2="-31.579377" y2="9.306587" />
<line x1="-20.226412" y1="17.764785" x2="-20.226412" y2="19.630272" />
<line x1="-20.226412" y1="19.630272" x2="-23.491366" y2="21.77427" />
<line x1="-28.314423" y1="7.162589" x2="-20.226412" y2="17.764785" />
<line x1="-28.314423" y1="9.028077" x2="-20.226412" y2="19.630272" />
<line x1="-31.579377" y1="11.172075" x2="-23.491366" y2="21.77427" />
<line x1="-10.144946" y1="-25.228788" x2="-10.144946" y2="-23.3633" />
<line x1="-10.144946" y1="-23.3633" x2="-16.674854" y2="-19.075304" />
<line x1="-16.674854" y1="-20.940792" x2="-16.674854" y2="-19.075304" />
<line x1="-10.144946" y1="-25.228788" x2="-16.674854" y2="-20.940792" />
<line x1="-0.32379" y1="-12.354693" x2="-0.32379" y2="-10.489206" />
<line x1="-0.32379" y1="-10.489206" x2="-6.853698" y2="-6.20121" />
<line x1="-10.144946" y1="-25.228788" x2="-0.32379" y2="-12.354693" />
<line x1="-10.144946" y1="-23.3633" x2="-0.32379" y2="-10.489206" />
<line x1="-16.674854" y1="-19.075304" x2="-6.853698" y2="-6.20121" />
<line x1="12.709732" y1="-39.490579" x2="12.709732" y2="-39.117482" />
<line x1="12.709732" y1="-39.117482" x2="-1.166323" y2="-30.00549" />
<line x1="-1.166323" y1="-30.378587" x2="-1.166323" y2="-30.00549" />
<line x1="12.709732" y1="-39.490579" x2="-1.166323" y2="-30.378587" />
<line x1="24.264033" y1="-24.344586" x2="24.264033" y2="-23.971488" />
<line x1="24.264033" y1="-23.971488" x2="10.387979" y2="-14.859496" />
<line x1="12.709732" y1="-39.490579" x2="24.264033" y2="-24.344586" />
<line x1="12.709732" y1="-39.117482" x2="24.264033" y2="-23.971488" />
<line x1="-1.166323" y1="-30.00549" x2="10.387979" y2="-14.859496" />
<line x1="11.99867" y1="37.52358" x2="11.99867" y2="39.389067" />
<line x1="11.99867" y1="39.389067" x2="4.652524" y2="44.213063" />
<line x1="4.652524" y1="42.347575" x2="4.652524" y2="44.213063" />
<line x1="11.99867" y1="37.52358" x2="4.652524" y2="42.347575" />
<line x1="19.508966" y1="47.368475" x2="19.508966" y2="49.233963" />
<line x1="19.508966" y1="49.233963" x2="12.16282" y2="54.057958" />
<line x1="11.99867" y1="37.52358" x2="19.508966" y2="47.368475" />
<line x1="11.99867" y1="39.389067" x2="19.508966" y2="49.233963" />
<line x1="4.652524" y1="44.213063" x2="12.16282" y2="54.057958" />
<line x1="36.750643" y1="39.642932" x2="36.750643" y2="41.135322" />
<line x1="36.750643" y1="41.135322" x2="26.955781" y2="47.567316" />
<line x1="26.955781" y1="46.074927" x2="26.955781" y2="47.567316" />
<line x1="36.750643" y1="39.642932" x2="26.955781" y2="46.074927" />
<line x1="37.906073" y1="41.157532" x2="37.906073" y2="42.649922" />
<line x1="37.906073" y1="42.649922" x2="28.111211" y2="49.081916" />
<line x1="36.750643" y1="39.642932" x2="37.906073" y2="41.157532" />
<line x1="36.750643" y1="41.135322" x2="37.906073" y2="42.649922" />
<line x1="26.955781" y1="47.567316" x2="28.111211" y2="49.081916" />
<line x1="3.873472" y1="34.902479" x2="3.873472" y2="36.767967" />
<line x1="3.873472" y1="36.767967" x2="2.240995" y2="37.839966" />
<line x1="2.240995" y1="35.974478" x2="2.240995" y2="37.839966" />
<line x1="3.873472" y1="34.902479" x2="2.240995" y2="35.974478" />
<line x1="6.184332" y1="37.931678" x2="6.184332" y2="39.797166" />
<line x1="6.184332" y1="39.797166" x2="4.551855" y2="40.869165" />
<line x1="3.873472" y1="34.902479" x2="6.184332" y2="37.931678" />
<line x1="3.873472" y1="36.767967" x2="6.184332" y2="39.797166" />
<line x1="2.240995" y1="37.839966" x2="4.551855" y2="40.869165" />
<line x1="-10.293694" y1="7.255239" x2="-10.293694" y2="8.001434" />
<line x1="-10.293694" y1="8.001434" x2="-11.926171" y2="9.073433" />
<line x1="-11.926171" y1="8.327238" x2="-11.926171" y2="9.073433" />
<line x1="-10.293694" y1="7.255239" x2="-11.926171" y2="8.327238" />
<line x1="-5.671974" y1="13.313637" x2="-5.671974" y2="14.059832" />
<line x1="-5.671974" y1="14.059832" x2="-7.304451" y2="15.131831" />
<line x1="-10.293694" y1="7.255239" x2="-5.671974" y2="13.313637" />
<line x1="-10.293694" y1="8.001434" x2="-5.671974" y2="14.059832" />
<line x1="-11.926171" y1="9.073433" x2="-7.304451" y2="15.131831" />
<line x1="36.39605" y1="-8.627841" x2="36.39605" y2="-7.881646" />
<line x1="36.39605" y1="-7.881646" x2="21.703757" y2="1.766345" />
<line x1="21.703757" y1="1.02015" x2="21.703757" y2="1.766345" />
<line x1="36.39605" y1="-8.627841" x2="21.703757" y2="1.02015" />
<line x1="39.86234" y1="-4.084043" x2="39.86234" y2="-3.337848" />
<line x1="39.86234" y1="-3.337848" x2="25.170047" y2="6.310143" />
<line x1="36.39605" y1="-8.627841" x2="39.86234" y2="-4.084043" />
<line x1="36.39605" y1="-7.881646" x2="39.86234" y2="-3.337848" />
<line x1="21.703757" y1="1.766345" x2="25.170047" y2="6.310143" />
<line x1="61.237798" y1="23.936045" x2="61.237798" y2="24.68224" />
<line x1="61.237798" y1="24.68224" x2="51.442936" y2="31.114234" />
<line x1="51.442936" y1="30.368039" x2="51.442936" y2="31.114234" />
<line x1="61.237798" y1="23.936045" x2="51.442936" y2="30.368039" />
<line x1="68.170379" y1="33.023641" x2="68.170379" y2="33.769836" />
<line x1="68.170379" y1="33.769836" x2="58.375517" y2="40.20183" />
<line x1="61.237798" y1="23.936045" x2="68.170379" y2="33.023641" />
<line x1="61.237798" y1="24.68224" x2="68.170379" y2="33.769836" />
<line x1="51.442936" y1="31.114234" x2="58.375517" y2="40.20183" />
<line x1="25.270715" y1="8.721297" x2="25.270715" y2="9.84059" />
<line x1="25.270715" y1="9.84059" x2="11.394661" y2="18.952581" />
<line x1="11.394661" y1="17.833289" x2="11.394661" y2="18.952581" />
<line x1="25.270715" y1="8.721297" x2="11.394661" y2="17.833289" />
<line x1="27.003861" y1="10.993196" x2="27.003861" y2="12.112489" />
<line x1="27.003861" y1="12.112489" x2="13.127806" y2="21.22448" />
<line x1="25.270715" y1="8.721297" x2="27.003861" y2="10.993196" />
<line x1="25.270715" y1="9.84059" x2="27.003861" y2="12.112489" />
<line x1="11.394661" y1="18.952581" x2="13.127806" y2="21.22448" />
<line x1="-28.266343" y1="-27.732592" x2="-28.266343" y2="-26.6133" />
<line x1="-28.266343" y1="-26.6133" x2="-42.142397" y2="-17.501308" />
<line x1="-42.142397" y1="-18.620601" x2="-42.142397" y2="-17.501308" />
<line x1="-28.266343" y1="-27.732592" x2="-42.142397" y2="-18.620601" />
<line x1="-17.867472" y1="-14.101198" x2="-17.867472" y2="-12.981906" />
<line x1="-17.867472" y1="-12.981906" x2="-31.743526" y2="-3.869914" />
<line x1="-28.266343" y1="-27.732592" x2="-17.867472" y2="-14.101198" />
<line x1="-28.266343" y1="-26.6133" x2="-17.867472" y2="-12.981906" />
<line x1="-42.142397" y1="-17.501308" x2="-31.743526" y2="-3.869914" />
<line x1="0.0" y1="-56.710818" x2="0.0" y2="-55.218428" />
<line x1="0.0" y1="-55.218428" x2="-16.32477" y2="-44.498438" />
<line x1="-16.32477" y1="-45.990828" x2="-16.32477" y2="-44.498438" />
<line x1="0.0" y1="-56.710818" x2="-16.32477" y2="-45.990828" />
<line x1="10.976586" y1="-42.322124" x2="10.976586" y2="-40.829734" />
<line x1="10.976586" y1="-40.829734" x2="-5.348184" y2="-30.109744" />
<line x1="0.0" y1="-56.710818" x2="10.976586" y2="-42.322124" />
<line x1="0.0" y1="-55.218428" x2="10.976586" y2="-40.829734" />
<line x1="-16.32477" y1="-44.498438" x2="-5.348184" y2="-30.109744" />
<line x1="42.162308" y1="25.859242" x2="42.162308" y2="27.351632" />
<line x1="42.162308" y1="27.351632" x2="30.734969" y2="34.855625" />
<line x1="30.734969" y1="33.363235" x2="30.734969" y2="34.855625" />
<line x1="42.162308" y1="25.859242" x2="30.734969" y2="33.363235" />
<line x1="43.895453" y1="28.131141" x2="43.895453" y2="29.623531" />
<line x1="43.895453" y1="29.623531" x2="32.468114" y2="37.127524" />
<line x1="42.162308" y1="25.859242" x2="43.895453" y2="28.131141" />
<line x1="42.162308" y1="27.351632" x2="43.895453" y2="29.623531" />
<line x1="30.734969" y1="34.855625" x2="32.468114" y2="37.127524" />
<line x1="1.652387" y1="62.504363" x2="1.652387" y2="64.36985" />
<line x1="1.652387" y1="64.36985" x2="-3.245044" y2="67.585847" />
<line x1="-3.245044" y1="65.72036" x2="-3.245044" y2="67.585847" />
<line x1="1.652387" y1="62.504363" x2="-3.245044" y2="65.72036" />
<line x1="7.429538" y1="70.077359" x2="7.429538" y2="71.942847" />
<line x1="7.429538" y1="71.942847" x2="2.532107" y2="75.158844" />
<line x1="1.652387" y1="62.504363" x2="7.429538" y2="70.077359" />
<line x1="1.652387" y1="64.36985" x2="7.429538" y2="71.942847" />
<line x1="-3.245044" y1="67.585847" x2="2.532107" y2="75.158844" />
<line x1="51.994357" y1="12.005799" x2="51.994357" y2="12.378896" />
<line x1="51.994357" y1="12.378896" x2="40.567018" y2="19.882889" />
<line x1="40.567018" y1="19.509792" x2="40.567018" y2="19.882889" />
<line x1="51.994357" y1="12.005799" x2="40.567018" y2="19.509792" />
<line x1="59.504653" y1="21.850694" x2="59.504653" y2="22.223792" />
<line x1="59.504653" y1="22.223792" x2="48.077314" y2="29.727785" />
<line x1="51.994357" y1="12.005799" x2="59.504653" y2="21.850694" />
<line x1="51.994357" y1="12.378896" x2="59.504653" y2="22.223792" />
<line x1="40.567018" y1="19.882889" x2="48.077314" y2="29.727785" />
<line x1="31.047866" y1="16.480843" x2="31.047866" y2="17.227038" />
<line x1="31.047866" y1="17.227038" x2="20.436766" y2="24.195031" />
<line x1="20.436766" y1="23.448836" x2="20.436766" y2="24.195031" />
<line x1="31.047866" y1="16.480843" x2="20.436766" y2="23.448836" />
<line x1="33.936441" y1="20.267341" x2="33.936441" y2="21.013536" />
<line x1="33.936441" y1="21.013536" x2="23.325341" y2="27.98153" />
<line x1="31.047866" y1="16.480843" x2="33.936441" y2="20.267341" />
<line x1="31.047866" y1="17.227038" x2="33.936441" y2="21.013536" />
<line x1="20.436766" y1="24.195031" x2="23.325341" y2="27.98153" />
<line x1="-18.493266" y1="20.409781" x2="-18.493266" y2="21.529074" />
<line x1="-18.493266" y1="21.529074" x2="-21.75822" y2="23.673072" />
<line x1="-21.75822" y1="22.553779" x2="-21.75822" y2="23.673072" />
<line x1="-18.493266" y1="20.409781" x2="-21.75822" y2="22.553779" />
<line x1="-10.405255" y1="31.011976" x2="-10.405255" y2="32.131269" />
<line x1="-10.405255" y1="32.131269" x2="-13.670209" y2="34.275267" />
<line x1="-18.493266" y1="20.409781" x2="-10.405255" y2="31.011976" />
<line x1="-18.493266" y1="21.529074" x2="-10.405255" y2="32.131269" />
<line x1="-21.75822" y1="23.673072" x2="-13.670209" y2="34.275267" />
<line x1="13.079726" y1="55.560016" x2="13.079726" y2="56.306211" />
<line x1="13.079726" y1="56.306211" x2="4.101103" y2="62.202205" />
<line x1="4.101103" y1="61.45601" x2="4.101103" y2="62.202205" />
<line x1="13.079726" y1="55.560016" x2="4.101103" y2="61.45601" />
<line x1="18.279162" y1="62.375713" x2="18.279162" y2="63.121908" />
<line x1="18.279162" y1="63.121908" x2="9.300538" y2="69.017902" />
<line x1="13.079726" y1="55.560016" x2="18.279162" y2="62.375713" />
<line x1="13.079726" y1="56.306211" x2="18.279162" y2="63.121908" />
<line x1="4.101103" y1="62.202205" x2="9.300538" y2="69.017902" />
<line x1="24.507065" y1="48.242571" x2="24.507065" y2="48.615669" />
<line x1="24.507065" y1="48.615669" x2="15.528442" y2="54.511663" />
<line x1="15.528442" y1="54.138566" x2="15.528442" y2="54.511663" />
<line x1="24.507065" y1="48.242571" x2="15.528442" y2="54.138566" />
<line x1="30.861931" y1="56.572868" x2="30.861931" y2="56.945965" />
<line x1="30.861931" y1="56.945965" x2="21.883308" y2="62.84196" />
<line x1="24.507065" y1="48.242571" x2="30.861931" y2="56.572868" />
<line x1="24.507065" y1="48.615669" x2="30.861931" y2="56.945965" />
<line x1="15.528442" y1="54.511663" x2="21.883308" y2="62.84196" />
<line x1="-18.773486" y1="-44.569378" x2="-18.773486" y2="-42.703891" />
<line x1="-18.773486" y1="-42.703891" x2="-31.017063" y2="-34.663898" />
<line x1="-31.017063" y1="-36.529385" x2="-31.017063" y2="-34.663898" />
<line x1="-18.773486" y1="-44.569378" x2="-31.017063" y2="-36.529385" />
<line x1="-7.796899" y1="-30.180684" x2="-7.796899" y2="-28.315197" />
<line x1="-7.796899" y1="-28.315197" x2="-20.040477" y2="-20.275204" />
<line x1="-18.773486" y1="-44.569378" x2="-7.796899" y2="-30.180684" />
<line x1="-18.773486" y1="-42.703891" x2="-7.796899" y2="-28.315197" />
<line x1="-31.017063" y1="-34.663898" x2="-20.040477" y2="-20.275204" />
<line x1="19.255041" y1="2.255051" x2="19.255041" y2="3.747441" />
<line x1="19.255041" y1="3.747441" x2="14.35761" y2="6.963438" />
<line x1="14.35761" y1="5.471048" x2="14.35761" y2="6.963438" />
<line x1="19.255041" y1="2.255051" x2="14.35761" y2="5.471048" />
<line x1="22.143617" y1="6.041549" x2="22.143617" y2="7.533939" />
<line x1="22.143617" y1="7.533939" x2="17.246186" y2="10.749936" />
<line x1="19.255041" y1="2.255051" x2="22.143617" y2="6.041549" />
<line x1="19.255041" y1="3.747441" x2="22.143617" y2="7.533939" />
<line x1="14.35761" y1="6.963438" x2="17.246186" y2="10.749936" />
<line x1="-33.465779" y1="-34.548289" x2="-33.465779" y2="-33.428997" />
<line x1="-33.465779" y1="-33.428997" x2="-48.97431" y2="-23.245006" />
<line x1="-48.97431" y1="-24.364299" x2="-48.97431" y2="-23.245006" />
<line x1="-33.465779" y1="-34.548289" x2="-48.97431" y2="-24.364299" />
<line x1="-29.999488" y1="-30.004491" x2="-29.999488" y2="-28.885199" />
<line x1="-29.999488" y1="-28.885199" x2="-45.50802" y2="-18.701208" />
<line x1="-33.465779" y1="-34.548289" x2="-29.999488" y2="-30.004491" />
<line x1="-33.465779" y1="-33.428997" x2="-29.999488" y2="-28.885199" />
<line x1="-48.97431" y1="-23.245006" x2="-45.50802" y2="-18.701208" />
<line x1="39.639218" y1="43.61598" x2="39.639218" y2="44.735272" />
<line x1="39.639218" y1="44.735272" x2="32.293072" y2="49.559268" />
<line x1="32.293072" y1="48.439975" x2="32.293072" y2="49.559268" />
<line x1="39.639218" y1="43.61598" x2="32.293072" y2="48.439975" />
<line x1="41.372363" y1="45.887879" x2="41.372363" y2="47.007171" />
<line x1="41.372363" y1="47.007171" x2="34.026217" y2="51.831167" />
<line x1="39.639218" y1="43.61598" x2="41.372363" y2="45.887879" />
<line x1="39.639218" y1="44.735272" x2="41.372363" y2="47.007171" />
<line x1="32.293072" y1="49.559268" x2="34.026217" y2="51.831167" />
<line x1="-51.423026" y1="-22.383203" x2="-51.423026" y2="-22.010105" />
<line x1="-51.423026" y1="-22.010105" x2="-62.034126" y2="-15.042112" />
<line x1="-62.034126" y1="-15.415209" x2="-62.034126" y2="-15.042112" />
<line x1="-51.423026" y1="-22.383203" x2="-62.034126" y2="-15.415209" />
<line x1="-41.601869" y1="-9.509108" x2="-41.601869" y2="-9.136011" />
<line x1="-41.601869" y1="-9.136011" x2="-52.21297" y2="-2.168017" />
<line x1="-51.423026" y1="-22.383203" x2="-41.601869" y2="-9.509108" />
<line x1="-51.423026" y1="-22.010105" x2="-41.601869" y2="-9.136011" />
<line x1="-62.034126" y1="-15.042112" x2="-52.21297" y2="-2.168017" />
<line x1="7.403244" y1="51.517466" x2="7.403244" y2="51.890563" />
<line x1="7.403244" y1="51.890563" x2="0.057097" y2="56.714559" />
<line x1="0.057097" y1="56.341461" x2="0.057097" y2="56.714559" />
<line x1="7.403244" y1="51.517466" x2="0.057097" y2="56.341461" />
<line x1="8.558674" y1="53.032065" x2="8.558674" y2="53.405163" />
<line x1="8.558674" y1="53.405163" x2="1.212527" y2="58.229158" />
<line x1="7.403244" y1="51.517466" x2="8.558674" y2="53.032065" />
<line x1="7.403244" y1="51.890563" x2="8.558674" y2="53.405163" />
<line x1="0.057097" y1="56.714559" x2="1.212527" y2="58.229158" />
<line x1="9.587142" y1="31.896678" x2="9.587142" y2="32.269775" />
<line x1="9.587142" y1="32.269775" x2="6.322188" y2="34.413773" />
<line x1="6.322188" y1="34.040676" x2="6.322188" y2="34.413773" />
<line x1="9.587142" y1="31.896678" x2="6.322188" y2="34.040676" />
<line x1="11.320287" y1="34.168577" x2="11.320287" y2="34.541674" />
<line x1="11.320287" y1="34.541674" x2="8.055333" y2="36.685672" />
<line x1="9.587142" y1="31.896678" x2="11.320287" y2="34.168577" />
<line x1="9.587142" y1="32.269775" x2="11.320287" y2="34.541674" />
<line x1="6.322188" y1="34.413773" x2="8.055333" y2="36.685672" />
<line x1="-64.482842" y1="-13.993759" x2="-64.482842" y2="-13.247564" />
<line x1="-64.482842" y1="-13.247564" x2="-75.093942" y2="-6.279571" />
<line x1="-75.093942" y1="-7.025766" x2="-75.093942" y2="-6.279571" />
<line x1="-64.482842" y1="-13.993759" x2="-75.093942" y2="-7.025766" />
<line x1="-56.394831" y1="-3.391564" x2="-56.394831" y2="-2.645369" />
<line x1="-56.394831" y1="-2.645369" x2="-67.005931" y2="4.322625" />
<line x1="-64.482842" y1="-13.993759" x2="-56.394831" y2="-3.391564" />
<line x1="-64.482842" y1="-13.247564" x2="-56.394831" y2="-2.645369" />
<line x1="-75.093942" y1="-6.279571" x2="-67.005931" y2="4.322625" />
<line x1="-54.661685" y1="-0.933116" x2="-54.661685" y2="-0.560019" />
<line x1="-54.661685" y1="-0.560019" x2="-61.191593" y2="3.727977" />
<line x1="-61.191593" y1="3.35488" x2="-61.191593" y2="3.727977" />
<line x1="-54.661685" y1="-0.933116" x2="-61.191593" y2="3.35488" />
<line x1="-46.573674" y1="9.669079" x2="-46.573674" y2="10.042177" />
<line x1="-46.573674" y1="10.042177" x2="-53.103582" y2="14.330173" />
<line x1="-54.661685" y1="-0.933116" x2="-46.573674" y2="9.669079" />
<line x1="-54.661685" y1="-0.560019" x2="-46.573674" y2="10.042177" />
<line x1="-61.191593" y1="3.727977" x2="-53.103582" y2="14.330173" />
</g>
<g fill="none" stroke="rgb(99,99,99)" stroke-width="0.12893788891198896" id="Hidden" stroke-dasharray="0.003275 0.388451">
<line x1="-0.732847" y1="75.997001" x2="-0.732847" y2="76.743196" />
<line x1="0.083391" y1="75.461001" x2="-0.732847" y2="75.997001" />
<line x1="-6.509998" y1="68.424004" x2="-0.732847" y2="75.997001" />
<line x1="41.234508" y1="50.898173" x2="41.234508" y2="51.271271" />
<line x1="43.683224" y1="49.290175" x2="41.234508" y2="50.898173" />
<line x1="40.656793" y1="50.140874" x2="41.234508" y2="50.898173" />
<line x1="-2.179389" y1="37.350072" x2="-2.179389" y2="37.72317" />
<line x1="-1.363151" y1="36.814073" x2="-2.179389" y2="37.350072" />
<line x1="-7.378825" y1="30.534375" x2="-2.179389" y2="37.350072" />
<line x1="0.50785" y1="34.262226" x2="0.50785" y2="35.008421" />
<line x1="13.567666" y1="25.686234" x2="0.50785" y2="34.262226" />
<line x1="-4.113871" y1="28.203828" x2="0.50785" y2="34.262226" />
<line x1="15.438666" y1="23.320935" x2="15.438666" y2="24.06713" />
<line x1="29.314721" y1="14.208944" x2="15.438666" y2="23.320935" />
<line x1="14.860951" y1="22.563636" x2="15.438666" y2="23.320935" />
<line x1="21.957682" y1="46.506672" x2="21.957682" y2="46.879769" />
<line x1="31.752544" y1="40.074678" x2="21.957682" y2="46.506672" />
<line x1="14.447386" y1="36.661776" x2="21.957682" y2="46.506672" />
<line x1="13.742708" y1="12.694844" x2="13.742708" y2="14.187234" />
<line x1="15.375185" y1="11.622845" x2="13.742708" y2="12.694844" />
<line x1="10.276418" y1="8.151046" x2="13.742708" y2="12.694844" />
<line x1="-18.556748" y1="8.898239" x2="-18.556748" y2="10.390629" />
<line x1="-6.31317" y1="0.858246" x2="-18.556748" y2="8.898239" />
<line x1="-28.377904" y1="-3.975855" x2="-18.556748" y2="8.898239" />
<line x1="-34.944999" y1="8.106687" x2="-34.944999" y2="9.972175" />
<line x1="-30.047568" y1="4.89069" x2="-34.944999" y2="8.106687" />
<line x1="-44.766155" y1="-4.767407" x2="-34.944999" y2="8.106687" />
<line x1="2.70264" y1="-12.459197" x2="2.70264" y2="-12.0861" />
<line x1="4.335117" y1="-13.531196" x2="2.70264" y2="-12.459197" />
<line x1="-7.696231" y1="-26.090591" x2="2.70264" y2="-12.459197" />
<line x1="13.769002" y1="31.814383" x2="13.769002" y2="33.679871" />
<line x1="17.033956" y1="29.670385" x2="13.769002" y2="31.814383" />
<line x1="12.035857" y1="29.542484" x2="13.769002" y2="31.814383" />
<line x1="7.112132" y1="14.012039" x2="7.112132" y2="14.758234" />
<line x1="9.560847" y1="12.404041" x2="7.112132" y2="14.012039" />
<line x1="5.378987" y1="11.74014" x2="7.112132" y2="14.012039" />
<line x1="19.154373" y1="-0.902298" x2="19.154373" y2="0.216994" />
<line x1="34.662904" y1="-11.086289" x2="19.154373" y2="-0.902298" />
<line x1="12.799507" y1="-9.232595" x2="19.154373" y2="-0.902298" />
<line x1="36.385157" y1="18.099696" x2="36.385157" y2="19.965184" />
<line x1="50.261211" y1="8.987705" x2="36.385157" y2="18.099696" />
<line x1="27.719431" y1="6.740201" x2="36.385157" y2="18.099696" />
<line x1="45.554224" y1="46.551779" x2="45.554224" y2="47.671071" />
<line x1="55.349086" y1="40.119785" x2="45.554224" y2="46.551779" />
<line x1="39.199358" y1="38.221483" x2="45.554224" y2="46.551779" />
<line x1="-3.223258" y1="11.51909" x2="-3.223258" y2="12.638382" />
<line x1="0.041696" y1="9.375092" x2="-3.223258" y2="11.51909" />
<line x1="-7.844979" y1="5.460692" x2="-3.223258" y2="11.51909" />
<line x1="-6.207993" y1="78.642247" x2="-6.207993" y2="79.015344" />
<line x1="-3.759278" y1="77.034248" x2="-6.207993" y2="78.642247" />
<line x1="-11.407429" y1="71.82655" x2="-6.207993" y2="78.642247" />
<line x1="2.15122" y1="5.529945" x2="2.15122" y2="7.022335" />
<line x1="14.394797" y1="-2.510047" x2="2.15122" y2="5.529945" />
<line x1="-1.892786" y1="0.228848" x2="2.15122" y2="5.529945" />
<line x1="-2.052427" y1="59.440412" x2="-2.052427" y2="60.932802" />
<line x1="-1.236188" y1="58.904413" x2="-2.052427" y2="59.440412" />
<line x1="-3.207857" y1="57.925813" x2="-2.052427" y2="59.440412" />
<line x1="29.001823" y1="31.650982" x2="29.001823" y2="32.02408" />
<line x1="40.429162" y1="24.146989" x2="29.001823" y2="31.650982" />
<line x1="26.690963" y1="28.621783" x2="29.001823" y2="31.650982" />
<line x1="-4.941002" y1="56.027012" x2="-4.941002" y2="56.773207" />
<line x1="5.670099" y1="49.059018" x2="-4.941002" y2="56.027012" />
<line x1="-8.407292" y1="51.483214" x2="-4.941002" y2="56.027012" />
<line x1="10.250123" y1="-11.341592" x2="10.250123" y2="-9.476104" />
<line x1="26.574893" y1="-22.061582" x2="10.250123" y2="-11.341592" />
<line x1="9.672408" y1="-12.098891" x2="10.250123" y2="-11.341592" />
<line x1="-23.491366" y1="19.908783" x2="-23.491366" y2="21.77427" />
<line x1="-20.226412" y1="17.764785" x2="-23.491366" y2="19.908783" />
<line x1="-31.579377" y1="9.306587" x2="-23.491366" y2="19.908783" />
<line x1="-6.853698" y1="-8.066697" x2="-6.853698" y2="-6.20121" />
<line x1="-0.32379" y1="-12.354693" x2="-6.853698" y2="-8.066697" />
<line x1="-16.674854" y1="-20.940792" x2="-6.853698" y2="-8.066697" />
<line x1="10.387979" y1="-15.232594" x2="10.387979" y2="-14.859496" />
<line x1="24.264033" y1="-24.344586" x2="10.387979" y2="-15.232594" />
<line x1="-1.166323" y1="-30.378587" x2="10.387979" y2="-15.232594" />
<line x1="12.16282" y1="52.192471" x2="12.16282" y2="54.057958" />
<line x1="19.508966" y1="47.368475" x2="12.16282" y2="52.192471" />
<line x1="4.652524" y1="42.347575" x2="12.16282" y2="52.192471" />
<line x1="28.111211" y1="47.589526" x2="28.111211" y2="49.081916" />
<line x1="37.906073" y1="41.157532" x2="28.111211" y2="47.589526" />
<line x1="26.955781" y1="46.074927" x2="28.111211" y2="47.589526" />
<line x1="4.551855" y1="39.003677" x2="4.551855" y2="40.869165" />
<line x1="6.184332" y1="37.931678" x2="4.551855" y2="39.003677" />
<line x1="2.240995" y1="35.974478" x2="4.551855" y2="39.003677" />
<line x1="-7.304451" y1="14.385636" x2="-7.304451" y2="15.131831" />
<line x1="-5.671974" y1="13.313637" x2="-7.304451" y2="14.385636" />
<line x1="-11.926171" y1="8.327238" x2="-7.304451" y2="14.385636" />
<line x1="25.170047" y1="5.563948" x2="25.170047" y2="6.310143" />
<line x1="39.86234" y1="-4.084043" x2="25.170047" y2="5.563948" />
<line x1="21.703757" y1="1.02015" x2="25.170047" y2="5.563948" />
<line x1="58.375517" y1="39.455635" x2="58.375517" y2="40.20183" />
<line x1="68.170379" y1="33.023641" x2="58.375517" y2="39.455635" />
<line x1="51.442936" y1="30.368039" x2="58.375517" y2="39.455635" />
<line x1="13.127806" y1="20.105188" x2="13.127806" y2="21.22448" />
<line x1="27.003861" y1="10.993196" x2="13.127806" y2="20.105188" />
<line x1="11.394661" y1="17.833289" x2="13.127806" y2="20.105188" />
<line x1="-31.743526" y1="-4.989207" x2="-31.743526" y2="-3.869914" />
<line x1="-17.867472" y1="-14.101198" x2="-31.743526" y2="-4.989207" />
<line x1="-42.142397" y1="-18.620601" x2="-31.743526" y2="-4.989207" />
<line x1="-5.348184" y1="-31.602134" x2="-5.348184" y2="-30.109744" />
<line x1="10.976586" y1="-42.322124" x2="-5.348184" y2="-31.602134" />
<line x1="-16.32477" y1="-45.990828" x2="-5.348184" y2="-31.602134" />
<line x1="32.468114" y1="35.635134" x2="32.468114" y2="37.127524" />
<line x1="43.895453" y1="28.131141" x2="32.468114" y2="35.635134" />
<line x1="30.734969" y1="33.363235" x2="32.468114" y2="35.635134" />
<line x1="2.532107" y1="73.293356" x2="2.532107" y2="75.158844" />
<line x1="7.429538" y1="70.077359" x2="2.532107" y2="73.293356" />
<line x1="-3.245044" y1="65.72036" x2="2.532107" y2="73.293356" />
<line x1="48.077314" y1="29.354687" x2="48.077314" y2="29.727785" />
<line x1="59.504653" y1="21.850694" x2="48.077314" y2="29.354687" />
<line x1="40.567018" y1="19.509792" x2="48.077314" y2="29.354687" />
<line x1="23.325341" y1="27.235335" x2="23.325341" y2="27.98153" />
<line x1="33.936441" y1="20.267341" x2="23.325341" y2="27.235335" />
<line x1="20.436766" y1="23.448836" x2="23.325341" y2="27.235335" />
<line x1="-13.670209" y1="33.155974" x2="-13.670209" y2="34.275267" />
<line x1="-10.405255" y1="31.011976" x2="-13.670209" y2="33.155974" />
<line x1="-21.75822" y1="22.553779" x2="-13.670209" y2="33.155974" />
<line x1="9.300538" y1="68.271707" x2="9.300538" y2="69.017902" />
<line x1="18.279162" y1="62.375713" x2="9.300538" y2="68.271707" />
<line x1="4.101103" y1="61.45601" x2="9.300538" y2="68.271707" />
<line x1="21.883308" y1="62.468862" x2="21.883308" y2="62.84196" />
<line x1="30.861931" y1="56.572868" x2="21.883308" y2="62.468862" />
<line x1="15.528442" y1="54.138566" x2="21.883308" y2="62.468862" />
<line x1="-20.040477" y1="-22.140692" x2="-20.040477" y2="-20.275204" />
<line x1="-7.796899" y1="-30.180684" x2="-20.040477" y2="-22.140692" />
<line x1="-31.017063" y1="-36.529385" x2="-20.040477" y2="-22.140692" />
<line x1="17.246186" y1="9.257546" x2="17.246186" y2="10.749936" />
<line x1="22.143617" y1="6.041549" x2="17.246186" y2="9.257546" />
<line x1="14.35761" y1="5.471048" x2="17.246186" y2="9.257546" />
<line x1="-45.50802" y1="-19.820501" x2="-45.50802" y2="-18.701208" />
<line x1="-29.999488" y1="-30.004491" x2="-45.50802" y2="-19.820501" />
<line x1="-48.97431" y1="-24.364299" x2="-45.50802" y2="-19.820501" />
<line x1="34.026217" y1="50.711874" x2="34.026217" y2="51.831167" />
<line x1="41.372363" y1="45.887879" x2="34.026217" y2="50.711874" />
<line x1="32.293072" y1="48.439975" x2="34.026217" y2="50.711874" />
<line x1="-52.21297" y1="-2.541115" x2="-52.21297" y2="-2.168017" />
<line x1="-41.601869" y1="-9.509108" x2="-52.21297" y2="-2.541115" />
<line x1="-62.034126" y1="-15.415209" x2="-52.21297" y2="-2.541115" />
<line x1="1.212527" y1="57.856061" x2="1.212527" y2="58.229158" />
<line x1="8.558674" y1="53.032065" x2="1.212527" y2="57.856061" />
<line x1="0.057097" y1="56.341461" x2="1.212527" y2="57.856061" />
<line x1="8.055333" y1="36.312575" x2="8.055333" y2="36.685672" />
<line x1="11.320287" y1="34.168577" x2="8.055333" y2="36.312575" />
<line x1="6.322188" y1="34.040676" x2="8.055333" y2="36.312575" />
<line x1="-67.005931" y1="3.57643" x2="-67.005931" y2="4.322625" />
<line x1="-56.394831" y1="-3.391564" x2="-67.005931" y2="3.57643" />
<line x1="-75.093942" y1="-7.025766" x2="-67.005931" y2="3.57643" />
<line x1="-53.103582" y1="13.957075" x2="-53.103582" y2="14.330173" />
<line x1="-46.573674" y1="9.669079" x2="-53.103582" y2="13.957075" />
<line x1="-61.191593" y1="3.35488" x2="-53.103582" y2="13.957075" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 44 KiB

View file

@ -136,3 +136,22 @@ will almost certainly be invalid (even if :meth:`~topology.Shape.is_valid` repor
An example of where this my arise is with the thread of a screw (or any helical shape) where after
one complete revolution the part may contact itself. One is likely be more successful if the part
is split into multiple sections - say 180° of a helix - which are then stored in an assembly.
**************************
Packing Objects on a Plane
**************************
When designing independent parts it's common to place each at or near
the global origin, which can make it tricky to visualize many parts at
once. :meth:`pack.pack` will translate the `Part`s passed to it so
that they don't overlap, with an optional padding/spacing. Here's the
result of packing a bunch of overlapping boxes (left) using some
padding (right):
.. image:: assets/packed_boxes_input.svg
:width: 200
:align: left
.. image:: assets/packed_boxes_output.svg
:align: right

34
examples/packed_boxes.py Normal file
View file

@ -0,0 +1,34 @@
"""
name: packed_boxes.py
by: fischman
date: November 9th 2023
desc: Demo packing a bunch of boxes in 2D.
"""
import functools
import operator
import random
import build123d as bd
random.seed(123456)
test_boxes = [bd.Box(random.randint(1, 20), random.randint(1, 20), random.randint(1, 5))
for _ in range(50)]
packed = bd.pack(test_boxes, 3)
# Lifted from https://build123d.readthedocs.io/en/latest/import_export.html#d-to-2d-projection
def export_svg(parts, name):
part = functools.reduce(operator.add, parts, bd.Part())
view_port_origin=(0, 0, 150)
visible, hidden = part.project_to_viewport(view_port_origin)
max_dimension = max(*bd.Compound(children=visible + hidden).bounding_box().size)
exporter = bd.ExportSVG(scale=100 / max_dimension)
exporter.add_layer("Visible")
exporter.add_layer("Hidden", line_color=(99, 99, 99), line_type=bd.LineType.ISO_DOT)
exporter.add_shape(visible, layer="Visible")
exporter.add_shape(hidden, layer="Hidden")
exporter.write(f"../docs/assets/{name}.svg")
export_svg(test_boxes, "packed_boxes_input")
export_svg(packed, "packed_boxes_output")

View file

@ -15,6 +15,7 @@ from build123d.objects_sketch import *
from build123d.operations_generic import *
from build123d.operations_part import *
from build123d.operations_sketch import *
from build123d.pack import *
from build123d.topology import *
from build123d.drafting import *
from build123d.persistence import modify_copyreg
@ -159,10 +160,11 @@ __all__ = [
"import_svg",
"import_svg_as_buildline_code",
# Other functions
"polar",
"delta",
"new_edges",
"edges_to_wires",
"new_edges",
"pack",
"polar",
# Operations
"add",
"bounding_box",

125
src/build123d/pack.py Normal file
View file

@ -0,0 +1,125 @@
"""
build123d Pack
name: pack.py
by: fischman
date: November 9th 2023
desc:
Utility code for packing objects in a squarish 2D area.
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Callable, Collection, Optional, cast
from build123d import Location, Part
def _pack2d(objects: Collection[object],
width_fn: Callable[[object], float],
length_fn: Callable[[object], float]) -> Collection[tuple[float,float]]:
"""Takes an iterable of objects to pack into a square(ish) 2D
arrangement, and return a list of (x,y) locations to place each to
achieve the packing.
Based on https://codeincomplete.com/articles/bin-packing/ and
implemented as a straight-forward port of
https://github.com/jakesgordon/bin-packing/blob/master/js/packer.growing.js
"""
@dataclass
class _Node:
used: bool = False
x: float = 0
y: float = 0
w: float = 0
h: float = 0
down: Optional["_Node"] = None
right: Optional["_Node"] = None
def find_node(start, w, h):
if start.used:
return find_node(start.right, w, h) or find_node(start.down, w, h)
if o[1] <= start.w and o[2] <= start.h:
return start
return None
def split_node(node, w, h):
assert not node.used
node.used = True
node.down = _Node(x=node.x, y=node.y+h, w=node.w, h=node.h-h)
node.right = _Node(x=node.x+w, y=node.y, w=node.w-w, h=h)
return node
def grow_node(w, h):
nonlocal root
can_grow_down = w <= root.w
can_grow_right = h <= root.h
should_grow_right = can_grow_right and (root.h >= (root.w + w))
should_grow_down = can_grow_down and (root.w >= (root.h + h))
if should_grow_right:
return grow_right(w, h)
if should_grow_down:
return grow_down(w, h)
if can_grow_right:
return grow_right(w, h)
if can_grow_down:
return grow_down(w, h)
assert False, f"Failed to grow! root: {root}, w: {w}, h: {h}"
def grow_right(w, h):
nonlocal root
root = _Node(used=True, x=0, y=0, w=root.w+w, h=root.h,
down=root, right=_Node(x=root.w, w=w, h=root.h))
node = find_node(root, w, h)
assert node, "Failed to grow right! root: {root}, w: {w}, h: {h}"
return split_node(node, w, h)
def grow_down(w, h):
nonlocal root
root = _Node(used=True, x=0, y=0, w=root.w, h=root.h+h,
down=_Node(y=root.h, w=root.w, h=h), right=root)
node = find_node(root, w, h)
assert node, "Failed to grow down! root: {root}, w: {w}, h: {h}"
return split_node(node, w, h)
assert len(objects)>0
sorted_objects = sorted([(i, width_fn(o), length_fn(o)) for (i, o) in enumerate(objects)],
key=lambda d: min(d[1], d[2]), reverse=True)
sorted_objects = sorted(sorted_objects, key=lambda d: max(d[1], d[2]), reverse=True)
root = _Node(False, w=sorted_objects[0][1], h=sorted_objects[0][2])
translations = []
for o in sorted_objects:
node = find_node(root, o[1], o[2])
if node:
node = split_node(node, o[1], o[2])
else:
node = grow_node(o[1], o[2])
translations.append((o[0], node.x, node.y))
return [(t[1], t[2]) for t in sorted(translations, key=lambda t: t[0])]
def pack(objects: Collection[Part], padding: float) -> Collection[Part]:
"""Pack objects in a squarish area in Plane.XY."""
bounding_boxes = {o: o.bounding_box().size + (padding, padding) for o in objects}
translations = _pack2d(
objects,
width_fn=lambda o: bounding_boxes[cast(Part, o)].X,
length_fn=lambda o: bounding_boxes[cast(Part, o)].Y)
translated = [
Location((t[0]-o.bounding_box().min.X, t[1]-o.bounding_box().min.Y, 0)) * o
for (o,t) in zip(objects, translations)
]
# Assert the packing didn't cause any overlaps.
def _overlapping(bb1, bb2):
# Boundaries of the intersection of the two bounding boxes.
min_x = max(bb1.min.X, bb2.min.X)
min_y = max(bb1.min.Y, bb2.min.Y)
max_x = min(bb1.max.X, bb2.max.X)
max_y = min(bb1.max.Y, bb2.max.Y)
return max_x > min_x and max_y > min_y
bb = [t.bounding_box() for t in translated]
for (i, bb_i) in enumerate(bb):
for (j, bb_j) in enumerate(bb[i+1:]):
assert not _overlapping(bb_i, bb_j), f"Objects at indexes {i} and {j} overlap!"
return translated

46
tests/test_pack.py Normal file
View file

@ -0,0 +1,46 @@
"""
build123d Pack tests
name: build_pack.py
by: fischman
date: November 9th 2023
desc: Unit tests for the build123d pack module
"""
import operator
import random
import unittest
from functools import reduce
from build123d import Box, Part, pack
class TestPack(unittest.TestCase):
"""Tests for the pack helper."""
def test_simple(self):
"""Test pack with hand-picked data against expected output."""
packed = pack([Box(10, 2, 1), Box(1, 5, 1), Box(1, 5, 1)], padding=1)
self.assertEqual(
# Nothing magically interesting here, and other packings
# would also be fine, but this shows that padding is
# working, as is the preference towards square(ish)
# output.
"[bbox: 0.0 <= x <= 10.0, 0.0 <= y <= 2.0, -0.5 <= z <= 0.5,"
" bbox: 0.0 <= x <= 1.0, 3.0 <= y <= 8.0, -0.5 <= z <= 0.5,"
" bbox: 2.0 <= x <= 3.0, 3.0 <= y <= 8.0, -0.5 <= z <= 0.5]",
str([p.bounding_box() for p in packed]))
def test_random_boxes(self):
"""Test pack with larger (and randomized) inputs."""
random.seed(123456)
# 50 is an arbitrary number that is large enough to exercise
# different aspects of the packer while still completing quickly.
test_boxes = [Box(random.randint(1, 20), random.randint(1, 20), 1)
for _ in range(50)]
# Not raising in this call shows successfull non-overlap.
packed = pack(test_boxes, 1)
self.assertEqual(
"bbox: 0.0 <= x <= 94.0, 0.0 <= y <= 86.0, -0.5 <= z <= 0.5",
str(reduce(operator.add, packed, Part()).bounding_box()))
if __name__ == "__main__":
unittest.main()