Giter VIP home page Giter VIP logo

cq-annotate's Introduction

banner image

Patreon    Ko-fi    Mastodon    Twitter

About Me

I am a core contributor to the CadQuery programmatic CAD project. I also create open hardware and work on other open engineering tools. Many of my hardware projects can be found on Codeberg.org, and more information can be found on my open source company's website: 7B Industries. Below are a few notable projects that I have created and/or work on. If you would like to support my open source work, you can contribute using GitHub Sponsors, Patreon, LiberaPay and Ko-fi.

Open Source Software

  • CadQuery - Python CAD API which allows creation of highly parametric CAD models and assemblies.
  • Semblage - Experimental CAD GUI that allows users to create programmatic (code) CAD using mouse clicks.
  • opc-build-system - Repository and Continuous Integration configs to build Python wheels for OCP, which makes it possible to install CadQuery from PyPI using pip.

Open Hardware

  • Stereoscope - Depth perception attachment for wildlife camera traps that allows wildlife populations to be more accurately determined.
  • Nimble - Wakoma.co project to automatically generate CAD and documentation for their portable internet-in-a-box system.
  • Push Button Switch - Switch created using 3D printing which allows a user to control a computer by pushing the button.
  • 3D Printed Braille Labels - Converts English text to a braille label which can be 3D printed (Try It).

GitHub Stats

Anurag's GitHub stats Top Langs

cq-annotate's People

Contributors

jmwright avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

cq-annotate's Issues

Selective explosion of sub-assemblies

I am just starting to have a play with assemblies and cq-annotate.

One thing I am delighted about is that I can assemble assemblies. This way we can have a complex nested object.

I made this code by modifying your example:

import cadquery as cq
from cq_annotate.views import explode_assembly

# Create the first assembly component for first assembly
box1 = cq.Workplane().workplane(offset=0.0).box(10, 10, 10)

# Create a second assembly component to be assembled with the first
box2 = cq.Workplane().workplane(offset=0.0).box(10, 10, 10)

# The first assembly
assy1 = cq.Assembly()


assy1.add(
    box1,
    loc=cq.Location((0, 0, 5)),
    metadata={"explode_loc": cq.Location((0, 0, 10))},
    color=cq.Color(1, 0, 0, 1),
)
assy1.add(
    box2,
    loc=cq.Location((0, 0, -5)),
    metadata={"explode_loc": cq.Location((0, 0, -10))},
    color=cq.Color(0, 1, 0, 1),
)


# Create the first assembly component for second assembly
box3 = cq.Workplane().workplane(offset=0.0).box(10, 10, 10)

# Create a second assembly component to be assembled with the first
box4 = cq.Workplane().workplane(offset=0.0).box(10, 10, 10)

# The second assembly
assy2 = cq.Assembly()

assy2.add(
    box3,
    loc=cq.Location((0, 0, 5)),
    metadata={"explode_loc": cq.Location((0, 0, 10))},
    color=cq.Color(1, 0, 0, 1),
)
assy2.add(
    box4,
    loc=cq.Location((0, 0, -5)),
    metadata={"explode_loc": cq.Location((0, 0, -10))},
    color=cq.Color(0, 1, 0, 1),
)

# The main assembly
assy3 = cq.Assembly()

assy3.add(
    assy1,
    loc=cq.Location((0, 5, 0)),
    metadata={"explode_loc": cq.Location((0, 10, 0))},
    color=cq.Color(1, 0, 0, 1),
)
assy3.add(
    assy2,
    loc=cq.Location((0, -5, 0)),
    metadata={"explode_loc": cq.Location((0, -10, 0))},
    color=cq.Color(0, 1, 0, 1),
)

explode_assembly(assy3)

# This only exists so that users running the example in CQ-editor
# can see the result
if "show_object" in globals():
    show_object(assy3)

When I explode, it nests and explodes all of the sub-assemblies as well. I can see this being needed in some cases (making big explosions of the whole assembly), but I can also see times when it only one layer of explosion is needed. When explaining a specific assembly step.

Short term suggestion

I think a short term and easy fix is probably to do something like def explode_assembly(assy, recursive=True): and then if recursive is false it doesn't traverse children.

Longer term suggestion

Have some way to identify sub-assemblies and explode identified ones. Perhaps via name?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.