CQ-editor icon indicating copy to clipboard operation
CQ-editor copied to clipboard

Segmentation fault when using `.faces()` and `.shell()`

Open revolter opened this issue 4 years ago • 4 comments

This example:

handle = (
    cq
    .Workplane('front')
    .box(1, 1, 1)
    .faces('>Y or >Z or <Z')
    .fillet(0.04)
    .faces('>Y or >Z or <Z')  # this causes the crash
    .shell(0.5)
)

show_object(
    handle,
    options={
        'alpha': 0
    }
)

triggers this error:

ERROR conda.cli.main_run:execute(33): Subprocess for 'conda run ['cq-editor']' command failed.  (See above for error)
Namespace(filename=None)

/usr/local/Caskroom/miniconda/base/.tmpxw95p3a5: line 3: 43088 Segmentation fault: 11  cq-editor

revolter avatar Aug 26 '21 20:08 revolter

It should be noted that this causes a segmentation fault in the Python repl on the command line too. It's not specific to CQ-editor.

@revolter I'm not sure what the design intent is here, but removing so many faces with shell is causing problems with the CAD kernel. You might try sweep or another operation if it is the horseshoe shape shown on Discord that you are interested in obtaining.

jmwright avatar Aug 27 '21 13:08 jmwright

It's not specific to CQ-editor.

Understood.

removing so many faces with shell is causing problems with the CAD kernel

Are you saying that it removes more than 3 faces (the number I thought) because of the fillet?

I'm not sure what the design intent is here

I'm trying to create a simplified version of this, but it beats me hard 😂

You might try sweep

Thanks for the hint! Will re-read the documentation, as I don't understand how it works.


I did find (just now) the examples folder and I hope that it will help me understand CQ even better.

revolter avatar Aug 27 '21 13:08 revolter

Are you saying that it removes more than 3 faces (the number I thought) because of the fillet?

The shell operation in CadQuery will remove the selected face and then essentially hollow out the inside of the solid from that face, using the given wall thickness. You have selected 1 Y face and 2 Z faces, so those faces will be removed and OCCT (the CAD kernel) will be trying to hollow the solid out starting from multiple faces. I don't think that's something we can expect the CAD kernel to handle properly.

I'll respond to your question about the part you're trying to make on Discord since we are getting off topic for CQ-editor.

jmwright avatar Aug 27 '21 13:08 jmwright

I don't think that's something we can expect the CAD kernel to handle properly.

But it seems "recommended" in the official examples page.

revolter avatar Aug 27 '21 13:08 revolter