Skip to content

Conversation

@cgevans
Copy link

@cgevans cgevans commented Aug 15, 2025

In order to allow objects with altered dimensions (eg, a unit other than 42 mm, or altered tolerance), this commit moves constants into a GridfinityConfig class. These can be altered through either passing an instance to the GridfinityObject constructor, or using the class as a context manager, for example:

# Creates a box and baseplate with a 20mm width unit and 5mm height unit.
with GridfinityConfig(GRU=20, GRHU=5):
    box = GridfinityBox(2, 1, 3)
    baseplate = GridfinityBaseplate(4, 3)

# This uses normal sizes
baseplate_normal = GridfinityBaseplate(4, 3)

I need to add tests and documentation.

In order to allow objects with altered dimensions (eg, a unit other than
42 mm, or altered tolerance), this commit moves constants into a
GridfinityConfig class.  These can be altered through either passing
an instance to the GridfinityObject constructor, or using the class
as a context manager.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant