cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

Creating a shell out of a tapered box causes an "BRep_Tool:: no parameter on edge" error

Open knower-to-be opened this issue 1 year ago • 0 comments

To Reproduce

I am trying to make a box with tapered walls using the following code, however I get an error OCP.Standard.Standard_NoSuchObject: BRep_Tool:: no parameter on edge.

import cadquery as cq

result = (
    cq.Workplane('XY')
    .rect(10, 10)
    .extrude(10, taper=-10.0)
    .faces(">Z")
    .shell(-0.5)
)
# cq.exporters.export(result, 'issue.stl')
show_object(result)

Backtrace

Traceback (most recent call last):
  File "issue.py", line 8, in <module>
    .shell(-0.5)
     ^^^^^^^^^^^
  File ".venv\Lib\site-packages\cadquery\cq.py", line 1276, in shell
    s = solidRef.shell(faces, thickness, kind=kind)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".venv\Lib\site-packages\cadquery\occ_impl\shapes.py", line 2848, in shell
    shell_builder.MakeThickSolidByJoin(
OCP.Standard.Standard_NoSuchObject: BRep_Tool:: no parameter on edge

What I have tried as a workaround to this error

Strangely, no such error occurs when I change the taper from -10deg to +10deg and select the bottom face instead of the top face. The resulting model is exactly the same, as the expected result from the first code block, but upside down. As a result, I do not understand by the first code does not work

import cadquery as cq

result = (
    cq.Workplane('XY')
    .rect(10, 10)
    .extrude(10, taper=10.0)
    .faces("<Z")
    .shell(-0.5)
)
cq.exporters.export(result, 'issue.stl')
show_object(result)

box

Environment

OS: Windows 10 Was CadQuery installed using Conda?: No, I installed it using pip. Output of conda list from your active Conda environment:

> python --version
Python 3.11.7

> pip list
Package           Version
----------------- -------
cadquery          2.4.0
cadquery-ocp      7.7.2
casadi            3.6.6
ezdxf             1.3.3
fonttools         4.53.1
multimethod       1.9.1
nlopt             2.8.0
nptyping          2.0.1
numpy             1.23.5
path              17.0.0
pip               23.2.1
pyparsing         3.1.4
setuptools        68.2.0
typing_extensions 4.12.2
typish            1.9.3
wheel             0.41.2

Using: PyCharm, CQ-Editor

knower-to-be avatar Sep 22 '24 16:09 knower-to-be