Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Best practice for hierarchial design

See original GitHub issue

I have migrated a design for a coffeetable from plain freecad python script into a cadquery/cqparts script.

I wonder what the best practice is to pass values between parts in an assembly.

Some of the dimensions for the parts depend on each other. The coffee table assembly needs only length, width and height but calculates some other variables that are used for other parts of the table.

When I did the design I studied your ball bearing script in parallell. You collect variables for the ball bearing assy like so: outer_diam = PositiveFloat(30, doc="outer diameter")

and then you pass them to the components, like so:

    def make_components(self):
        return {
            'outer_ring': _Ring(
                outer_radius=self.outer_diam / 2,
                inner_radius=(self.outer_diam / 2) - self.outer_width,
                ball_radius=(self.ball_diam / 2) + self.tolerance,

and then the subcomponents need to collect the variables again in the same way as the assembly did.

outer_radius = PositiveFloat(10, doc="outside radius")

Doesnt this feel like duplicated effort?

Wouldnt it be possible for a subcomponent to get the variables directly from the parent?

My suggestion is to use for example super.outer_diam in the subcomponent, is there something inherently bad with this approach?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

gntechcommented, May 10, 2018

@fragmuffin I have now uploaded the design files for the coffee table I mentioned to here

I have also written a blog post about it on my website

fragmuffincommented, May 10, 2018

@gntech that is so cool!

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Best practices' improve hierarchical design constraints
This article provides insight into the nature of constraints and descriptions of best practices for managing constraints in hierarchical design flows.
Read more >
A Non-Designer's Guide to Visual Hierarchy [Best Practices + ...
Web Design Principles for Visual Hierarchy · 1. Consider reading patterns. · 2. Users notice bigger elements more easily. · 3. Color and...
Read more >
10 Hierarchical Best Practices - CLIMB
1. Organize data into hierarchical structures · 2. Avoid circular references in the hierarchy · 3. Design a clear and consistent navigation ...
Read more >
Guidelines for Hierarchical Network Design
Finally, one other guideline for hierarchical network design is that you should design the access layer first, followed by the distribution ...
Read more >
12 Visual Hierarchy Principles Non-Designers Needs to Know
Visual hierarchy is a method of organizing design elements in order of importance. In other words, it's a set of principles that influence ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found