CadQuery / CadQuery/cadquery

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

Open
#1,488 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

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.

~~~python
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](https://github.com/CadQuery/cadquery/assets/1653222/0bf5dbe6-a42c-4d6a-a14e-9079a63db56b)
![Снимок экрана от 2024-01-09 19-42-49](https://github.com/CadQuery/cadquery/assets/1653222/5eb5b925-13bf-4aad-bead-324be205cca1)
![Снимок экрана от 2024-01-09 19-43-29](https://github.com/CadQuery/cadquery/assets/1653222/75603854-bbd0-45ae-b328-15010abe682a)

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:

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

also won't hang in this ways:
~~~python
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:
~~~python
result4 = (
cq.Workplane("XY")
.ellipse(30, 25).ellipse(27, 22)
.ellipse(30, 25).extrude(6)
)
~~~

even less time to hang:
~~~python
result6 = (
cq.Workplane("XY")
.ellipse(31, 25).ellipse(27, 22).extrude(6)
.ellipse(31, 25).extrude(6)
)
~~~

won't hang, but would draw nothing:
~~~python
result7 = (
cq.Workplane("XY")
.ellipse(27, 25).ellipse(27, 22).extrude(6)
.ellipse(27, 25).extrude(6)
)
~~~

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.