Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bd_shape_history-0.1.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bd_shape_history-0.1.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file bd_shape_history-0.1.1.tar.gz.

File metadata

  • Download URL: bd_shape_history-0.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/6.8.0-49-generic

File hashes

Hashes for bd_shape_history-0.1.1.tar.gz
Algorithm Hash digest
SHA256 40e50bcacb34e3ec5105a28659735104ca79dcea7164766643a080e9b7b3bf1f
MD5 a30088413c67f547aa5eeb33750126ea
BLAKE2b-256 c2db0db016e239b3f2c6b85708fc7b3f7607c73918d5af66f80edde1478e1c62

See more details on using hashes here.

File details

Details for the file bd_shape_history-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bd_shape_history-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/6.8.0-49-generic

File hashes

Hashes for bd_shape_history-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1da9450a189eeef4886f9487dee1a0f9858844677cc1d04fb3fa39c6de2f500c
MD5 81d9198f447440d90b5d87264f1be178
BLAKE2b-256 0132eb71a54cd436a8d2aa54f1788e0d242d6639194f1ced304fa6ec82e421df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page