tpaviot / pythonocc-core

Python package for 3D geometry CAD/BIM/CAM
GNU Lesser General Public License v3.0
1.39k stars 380 forks source link

BRepPrimAPI_MakeBox does not accept keyword argument 'P' #1361

Closed Bill-XU closed 3 months ago

Bill-XU commented 3 months ago

Hello,

I wanted to create a box at a start point. I thought that this can be done by calling BRepPrimAPI_MakeBox with arguments P, dx, dy, dz.

But when I executed the code below,

from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox
from OCC.Core.gp import gp_Pnt

BRepPrimAPI_MakeBox(P=gp_Pnt(5.0, 5.0, 5.0),dx=10.0,dy=20.0,dz=30.0)

an error occurred.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[4], [line 4](vscode-notebook-cell:?execution_count=4&line=4)
      [1](vscode-notebook-cell:?execution_count=4&line=1) from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox
      [2](vscode-notebook-cell:?execution_count=4&line=2) from OCC.Core.gp import gp_Pnt
----> [4](vscode-notebook-cell:?execution_count=4&line=4) BRepPrimAPI_MakeBox(P=gp_Pnt(5.0, 5.0, 5.0))

TypeError: BRepPrimAPI_MakeBox.__init__() got an unexpected keyword argument 'P'

I saw comments for this usage, and double checked OCCT specs. The usage of 'P' should be fine.

Parameters P: gp_Pnt dx: float dy: float dz: float

Return None

Description Make a box with a corner at p and size dx, dy, dz.

How can I resolve this error?

Best regards, Bill

Bill-XU commented 3 months ago

UPDATE

it seems that passing parameters without keywords succeeded.

from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox
from OCC.Core.gp import gp_Pnt

pnt = gp_Pnt(5.0, 5.0, 5.0)
BRepPrimAPI_MakeBox(pnt,10.0,20.0,30.0)