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

revolve entire 360° #259

Closed
asprionj opened this issue Dec 28, 2019 · 8 comments
Closed

revolve entire 360° #259

asprionj opened this issue Dec 28, 2019 · 8 comments
Labels

Comments

@asprionj
Copy link

(I'm on 2.0RC1.) I want to create a simple torus, i.e. revolving a circle. If I revolve for anything shy of 360°, it works:

cq.Workplane('XY').circle(10).revolve(350, [-30,0,0], [-30,1,0])

image

However, if I want the full 360°, I somehow do not get a solid (?), at least it is shown very differently:

cq.Workplane('XY').circle(10).revolve(360, [-30,0,0], [-30,1,0])

image

What happened here? What's the difference? Is it intended?

@adam-urbanczyk
Copy link
Member

Confirmed, it is a bug. Funny enough the following works as expected:

res = cq.Workplane('XY').rect(2,2).revolve(360, (-30,0,0), (-30,1,0))

@adam-urbanczyk
Copy link
Member

I found the following workaround:

res = cq.Workplane('XY').circle(10).revolve(360, [-30,0,0], [-30,1,0],clean=False)

afbeelding

@RubenRubens
Copy link
Contributor

RubenRubens commented Feb 5, 2020

The bug is at exporting the geometry as STL. When it's exported as STEP it works fine. Tested with 2.0RC1.

STL

import cadquery as cq
res = cq.Workplane('XY').circle(10).revolve(360, [-30,0], [-30,1], clean=True)
res.val().exportStl('test.stl', precision=0.1)

STEP

import cadquery as cq
res = cq.Workplane('XY').circle(10).revolve(360, [-30,0], [-30,1], clean=True)
res.val().exportStep('test.step')

bug_259

@adam-urbanczyk
Copy link
Member

@RubenRubens I don't that this is the case:

res = cq.Workplane('XY').circle(10).revolve(360, [-30,0], [-30,1], clean=True).val().isValid()

results in a False. It has nothing to do with the export. It is rather interesting that the STEP exporter does not mind.

@RubenRubens
Copy link
Contributor

Good to know. 👍

@shimwell
Copy link
Contributor

I also stumbled across this bug today

A list of points connecting with a spline and rotated to 360 degrees doesn't export anything to the STL file but the STEP export worked fine.

The same list of points connected with a polyline exported fine to both STL and STEP.

The same list of points connected with a mixture of spines and straight lines exported fine to both STL and STEP.

@jmwright
Copy link
Member

Just tested the code posted by @shimwell on #322 with the OCP branch (and OCCT 7.4) and the stl export worked fine. I'm hoping to get some time to put a CQ 2.0 release together within the next few days. Once that has been published, we can merge the OCP branch and move to OCCT 7.4 for the CQ 2.1 release cycle. Numerous issues will be solved by moving to OCCT 7.4 in addition to this one.

Screenshot from 2020-04-16 08-36-59

@adam-urbanczyk
Copy link
Member

OCP is merged into master and the full rotation works as expected:
obraz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants