Skip to main content

Build132d Shape History

A tool to manage and visualize the modification history of Build123D objects.

Installation

This package is published on Pypi:

pip install bd_shape_history

Usage

Assuming a simple part created in 3 steps:

box = _.Box(3, 3, 1)
cbox = _.chamfer(box.edges()[0], 0.5)
cboxh = cbox - _.Cylinder(0.75, 1)

We can build the history with:

hm = ShapeHistory.from_globals()

And then display it diff() (here with VScode OCP CAD viewer):

ov.set_defaults(render_edges=False)
ov.show(*hm.diff(), names=hm.labels())

This shows a visual diff between each step:

Notice how the object is colored:

  • new faces and edges are green and light green;
  • unchanged faces and edges are gray and black;
  • modified faces and edges are dark green and olive

See the examples folder for more details.

Command line interface

You can compare two files and export the diff as an image using the ocp_diff script. For instance:

ocp_diff ./examples/a.py:box ./examples/b.py:box img.png

How does it work

ShapeHistory compares the hash of faces, edges and vertices between each steps:

  • a face or edge whose hash is found on the previous step is considered unmodified;
  • a face whose all edges are not found in the previous step is considered added (and same for edge / vertices);
  • otherwise the face or edge is considered modified.

Metadata

Release files for bd_shape_history 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bd_shape_history 0.1.1
File Size Uploaded
bd_shape_history-0.1.1.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bd_shape_history 0.1.1
File Interpreter ABI Platform
bd_shape_history-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / bd_shape_history-0.1.1.tar.gz

Download URL bd_shape_history-0.1.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
40e50bcacb34e3ec5105a28659735104ca79dcea7164766643a080e9b7b3bf1f
BLAKE2b-256 checksum
How to use checksums
c2db0db016e239b3f2c6b85708fc7b3f7607c73918d5af66f80edde1478e1c62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.10.12 Linux/6.8.0-49-generic

Release files / bd_shape_history-0.1.1-py3-none-any.whl

Download URL bd_shape_history-0.1.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1da9450a189eeef4886f9487dee1a0f9858844677cc1d04fb3fa39c6de2f500c
BLAKE2b-256 checksum
How to use checksums
0132eb71a54cd436a8d2aa54f1788e0d242d6639194f1ced304fa6ec82e421df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.10.12 Linux/6.8.0-49-generic

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page