Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap TopoDS_CompSolid #681

Merged
merged 1 commit into from
Mar 10, 2021
Merged

Wrap TopoDS_CompSolid #681

merged 1 commit into from
Mar 10, 2021

Conversation

adam-urbanczyk
Copy link
Member

Will resolve #606

@codecov
Copy link

codecov bot commented Mar 9, 2021

Codecov Report

Merging #681 (dafb6ac) into master (0325474) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #681      +/-   ##
==========================================
+ Coverage   94.19%   94.21%   +0.01%     
==========================================
  Files          31       31              
  Lines        6689     6702      +13     
  Branches      725      726       +1     
==========================================
+ Hits         6301     6314      +13     
  Misses        253      253              
  Partials      135      135              
Impacted Files Coverage Δ
cadquery/occ_impl/shapes.py 91.95% <100.00%> (+0.03%) ⬆️
tests/test_cadquery.py 99.10% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0325474...dafb6ac. Read the comment docs.

Copy link
Member

@marcus7070 marcus7070 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pulled and run this, all looks good.

from OCP.BRepPrimAPI import BRepPrimAPI_MakePrism

tool = cq.Solid.makeSphere(1, angleDegrees3=120)
shell = tool.Shells()[0]
v = cq.Vector(0, 0, 1)

builder = BRepPrimAPI_MakePrism(shell.wrapped, v.wrapped)
result = cq.Shape.cast(builder.Shape())
show_object(result)
offset = result.BoundingBox().xlen + 0.5
for val in result.Solids():
    show_object(
        val.translate(cq.Vector(offset, 0, 0)),
        options = {"color": "green"}
    )
    offset += val.BoundingBox().xlen + 0.5

produced:
screenshot2021-03-10-080658
Which is cool!

Copy link
Member

@jmwright jmwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adam-urbanczyk Thanks! Looks good.

@marcus7070 marcus7070 merged commit 48deb19 into master Mar 10, 2021
@marcus7070 marcus7070 deleted the compsolid branch March 12, 2021 03:46
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.

Wrap COMPSOLID
3 participants