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

Simple combination of some ellipses and extrude eats memory and hangs app #1488

Open
sadr0b0t opened this issue Jan 9, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@sadr0b0t
Copy link

sadr0b0t commented Jan 9, 2024

Hello,

This simple code being ran from CQ-Editor eats about 2Gb of memory (from 3.4 to 5.4Gb), cpu 100% and hangs app for about a minute or so. The app did terminate when I first saw that, but it was the os who killed it because of memory consumption. If I give enough memory, it would finally render the model after about a minute.

import cadquery as cq
result2 = (
    cq.Workplane("XY")
    .ellipse(30, 25).ellipse(27, 22).extrude(6)
    .ellipse(30, 25).extrude(6)
)

Just paste code to CQ-Editor and press render. It happens all of the time.

Снимок экрана от 2024-01-09 19-41-51
Снимок экрана от 2024-01-09 19-42-49
Снимок экрана от 2024-01-09 19-43-29

I have made some experiments and it seems that this is some kind of lucky magic combination or figures, operations and numbers. For example, it won't hang in this way:

result10 = (
    cq.Workplane("XY")
    .ellipse(10,10).ellipse(8,8).extrude(6)
    .ellipse(10,10).extrude(6)
)

also won't hang in this ways:

result3 = (
    cq.Workplane("XY")
    .ellipse(30, 25).ellipse(27, 22).extrude(6)
    .ellipse(30, 26).extrude(6)
)

result5 = (
    cq.Workplane("XY")
    .ellipse(30, 25).extrude(6)
    .ellipse(30, 25).extrude(6)
)

result5 = (
    cq.Workplane("XY")
    .ellipse(10, 25).ellipse(27, 22).extrude(6)
    .ellipse(10, 25).extrude(6)
)

result9 = (
    cq.Workplane("XY")
    .ellipse(26, 25).ellipse(27, 22).extrude(6)
    .ellipse(26, 25).extrude(6)
)

it would also hang in this way but for much less time:

result4 = (
    cq.Workplane("XY")
    .ellipse(30, 25).ellipse(27, 22)
    .ellipse(30, 25).extrude(6)
)

even less time to hang:

result6 = (
    cq.Workplane("XY")
    .ellipse(31, 25).ellipse(27, 22).extrude(6)
    .ellipse(31, 25).extrude(6)
)

won't hang, but would draw nothing:

result7 = (
    cq.Workplane("XY")
    .ellipse(27, 25).ellipse(27, 22).extrude(6)
    .ellipse(27, 25).extrude(6)
)
@sadr0b0t sadr0b0t added the bug Something isn't working label Jan 9, 2024
@lorenzncode
Copy link
Member

Try relaxing the 3D Viewer tolerances:

cq-editor_prefs_deviation

See also duplicate: CadQuery/CQ-editor#384

@adam-urbanczyk
Copy link
Member

adam-urbanczyk commented Jan 12, 2024

I cannot reproduce. BTW you probably wanted:

import cadquery as cq
result2 = (
    cq.Workplane("XY")
    .ellipse(30, 25).ellipse(27, 22)
    .extrude(6)
    .faces('>Z')
    .ellipse(30, 25).extrude(6)
)

@sadr0b0t
Copy link
Author

BTW you probably wanted:

yes, I have already drawn what I wanted in similar way, but one can press "render" when design syntax "compiles", but has such logical errors, and receive hang or killed app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants