Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cadquery/occ_impl/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
Quantity_TOC_RGB,
)
from OCP.BRepAlgoAPI import BRepAlgoAPI_Fuse
from OCP.TopTools import TopTools_ListOfShape
from OCP import List_TopoDS_Shape as TopTools_ListOfShape
from OCP.BOPAlgo import BOPAlgo_GlueEnum, BOPAlgo_Builder
from OCP.TopoDS import TopoDS_Shape
from OCP.gp import gp_EulerSequence
Expand Down
4 changes: 3 additions & 1 deletion cadquery/occ_impl/exporters/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
)
from OCP.PCDM import PCDM_StoreStatus
from OCP.RWGltf import RWGltf_CafWriter
from OCP.TColStd import TColStd_IndexedDataMapOfStringString
from OCP import (
IndexedDataMap_TCollection_AsciiString_TCollection_AsciiString as TColStd_IndexedDataMapOfStringString,
)
from OCP.Message import Message_ProgressRange
from OCP.Interface import Interface_Static

Expand Down
4 changes: 2 additions & 2 deletions cadquery/occ_impl/geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def _rotate(self, direction: gp_Ax1, angle: float):
new = gp_Trsf()
new.SetRotation(direction, angle)

self.wrapped = self.wrapped * gp_GTrsf(new)
self.wrapped = self.wrapped.Multiplied(gp_GTrsf(new))

def inverse(self) -> "Matrix":

Expand Down Expand Up @@ -1135,7 +1135,7 @@ def inverse(self) -> "Location":

def __mul__(self, other: "Location") -> "Location":

return Location(self.wrapped * other.wrapped)
return Location(self.wrapped.Multiplied(other.wrapped))

def __pow__(self, exponent: int) -> "Location":

Expand Down
3 changes: 2 additions & 1 deletion cadquery/occ_impl/importers/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from OCP.TopoDS import TopoDS_Shape
from OCP.TCollection import TCollection_ExtendedString
from OCP.Quantity import Quantity_ColorRGBA
from OCP.TDF import TDF_Label, TDF_LabelSequence
from OCP.TDF import TDF_Label
from OCP import Sequence_TDS_Label as TDF_LabelSequence
from OCP.IFSelect import IFSelect_RetDone
from OCP.TDocStd import TDocStd_Document
from OCP.TDataStd import TDataStd_Name, TDataStd_TreeNode
Expand Down
9 changes: 6 additions & 3 deletions cadquery/occ_impl/importers/dxf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
import ezdxf

from OCP.ShapeAnalysis import ShapeAnalysis_FreeBounds
from OCP.TopTools import TopTools_HSequenceOfShape
from OCP import HSequence_TopoDS_Shape as TopTools_HSequenceOfShape
from OCP.gp import gp_Pnt
from OCP.Geom import Geom_BSplineCurve
from OCP.TColgp import TColgp_Array1OfPnt
from OCP.TColStd import TColStd_Array1OfReal, TColStd_Array1OfInteger
from OCP import Arra1_gp_Pnt as TColgp_Array1OfPnt
from OCP import (
Array1_double as TColStd_Array1OfReal,
Array1_int as TColStd_Array1OfInteger,
)
from OCP.BRepBuilderAPI import BRepBuilderAPI_MakeEdge


Expand Down
8 changes: 4 additions & 4 deletions cadquery/occ_impl/nurbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
from casadi import ldl, ldl_solve, Linsol, DM, solve

from OCP.Geom import Geom_BSplineCurve, Geom_BSplineSurface
from OCP.TColgp import TColgp_Array1OfPnt, TColgp_Array2OfPnt
from OCP.TColStd import (
TColStd_Array1OfInteger,
TColStd_Array1OfReal,
from OCP import Array1_gp_Pnt as TColgp_Array1OfPnt, Array2_gp_Pnt as TColgp_Array2OfPnt
from OCP import (
Array1_int as TColStd_Array1OfInteger,
Array1_double as TColStd_Array1OfReal,
)
from OCP.gp import gp_Pnt
from OCP.BRepBuilderAPI import BRepBuilderAPI_MakeEdge, BRepBuilderAPI_MakeFace
Expand Down
39 changes: 19 additions & 20 deletions cadquery/occ_impl/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@
)

# Array of points (used for B-spline construction):
from OCP.TColgp import (
TColgp_HArray1OfPnt,
TColgp_HArray2OfPnt,
TColgp_Array1OfPnt,
TColgp_HArray1OfPnt2d,
from OCP import (
HArray1_gp_Pnt as TColgp_HArray1OfPnt,
HArray2_gp_Pnt as TColgp_HArray2OfPnt,
Array1_gp_Pnt as TColgp_Array1OfPnt,
HArray2_gp_Pnt2d as TColgp_HArray1OfPnt2d,
)

# Array of vectors (used for B-spline interpolation):
from OCP.TColgp import TColgp_Array1OfVec
from OCP import Array1_gp_Vec as TColgp_Array1OfVec

# Array of booleans (used for B-spline interpolation):
from OCP.TColStd import TColStd_HArray1OfBoolean
from OCP import HArray1_bool as TColStd_HArray1OfBoolean

# Array of floats (used for B-spline interpolation):
from OCP.TColStd import TColStd_HArray1OfReal
from OCP import HArray1_double as TColStd_HArray1OfReal

from OCP.BRepAdaptor import (
BRepAdaptor_Curve,
Expand Down Expand Up @@ -141,8 +141,7 @@
TopoDS_CompSolid,
)

from OCP.GC import GC_MakeArcOfCircle, GC_MakeArcOfEllipse # geometry construction
from OCP.GCE2d import GCE2d_MakeSegment
from OCP.GC import GC_MakeArcOfCircle, GC_MakeArcOfEllipse, GC_MakeSegment2d
from OCP.gce import gce_MakeLin, gce_MakeDir
from OCP.GeomAPI import (
GeomAPI_Interpolate,
Expand Down Expand Up @@ -195,11 +194,11 @@
BRepFilletAPI_MakeFillet2d,
)

from OCP.TopTools import (
TopTools_IndexedDataMapOfShapeListOfShape,
TopTools_ListOfShape,
TopTools_MapOfShape,
TopTools_IndexedMapOfShape,
from OCP import (
IndexedDataMap_TopoDS_Shape_List_TopoDS_Shape as TopTools_IndexedDataMapOfShapeListOfShape,
List_TopoDS_Shape as TopTools_ListOfShape,
Map_TopoDS_Shape as TopTools_MapOfShape,
IndexedMap_TopoDS_Shape as TopTools_IndexedMapOfShape,
)


Expand Down Expand Up @@ -242,7 +241,7 @@
Graphic3d_VTA_TOP,
)

from OCP.NCollection import NCollection_Utf8String
from OCP.NCollection import NCollection_String as NCollection_Utf8String

from OCP.BRepFeat import BRepFeat_MakeDPrism, BRepFeat_MakePrism

Expand Down Expand Up @@ -288,7 +287,7 @@
ShapeAnalysis,
ShapeAnalysis_WireOrder,
)
from OCP.TopTools import TopTools_HSequenceOfShape
from OCP import HSequence_TopoDS_Shape as TopTools_HSequenceOfShape

from OCP.GCPnts import (
GCPnts_AbscissaPoint,
Expand Down Expand Up @@ -327,7 +326,7 @@

from OCP.Approx import Approx_ParametrizationType

from OCP.LProp3d import LProp3d_CLProps
from OCP.LProp3d import LProp3d_CLProps # FIXME

from OCP.BinTools import BinTools

Expand Down Expand Up @@ -3158,7 +3157,7 @@ def makeHelix(
n_turns = height / pitch
u_start = geom_line.Value(0.0)
u_stop = geom_line.Value(n_turns * sqrt((2 * pi) ** 2 + pitch ** 2))
geom_seg = GCE2d_MakeSegment(u_start, u_stop).Value()
geom_seg = GC_MakeSegment2d(u_start, u_stop).Value()

e = BRepBuilderAPI_MakeEdge(geom_seg, geom_surf).Edge()

Expand Down Expand Up @@ -3897,7 +3896,7 @@ def trim(

# build (u,v) segments
for el1, el2 in zip((pt1, pt2, pt3, *pts), (pt2, pt3, *pts, pt1)):
segs_uv.append(GCE2d_MakeSegment(gp_Pnt2d(*el1), gp_Pnt2d(*el2)).Value())
segs_uv.append(GC_MakeSegment2d(gp_Pnt2d(*el1), gp_Pnt2d(*el2)).Value())

# convert to edges
edges = []
Expand Down
2 changes: 1 addition & 1 deletion cadquery/occ_impl/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def point_in_plane_cost(
m1_dm = ca.DM((m1.X(), m1.Y(), m1.Z()))

m2_dir = m2.Axis().Direction()
m2_pnt = m2.Axis().Location().Translated(val * gp_Vec(m2_dir))
m2_pnt = m2.Axis().Location().Translated(gp_Vec(m2_dir).Scaled(val))

m2_dir_dm = ca.DM((m2_dir.X(), m2_dir.Y(), m2_dir.Z()))
m2_pnt_dm = ca.DM((m2_pnt.X(), m2_pnt.Y(), m2_pnt.Z()))
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ channels:
dependencies:
- python>=3.11
- ipython
# - cadquery/label/dev::ocp=x.x.x for dev
- ocp=7.9.3.1
- cadquery/label/dev::ocp=8.0.0.0
# - ocp=7.9.3.1
- pyparsing>=3.0.0
- sphinx=9.1.0
# - sphinx_rtd_theme=3.1.0
Expand Down
Loading