Skip to content

Commit dc9b0e7

Browse files
authored
Merge pull request #633 from CadQuery/7.5
Move to OCCT/OCP 7.5
2 parents d350c1b + 0885b19 commit dc9b0e7

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ before_install:
5858
- conda env create -f environment.yml
5959
- source ~/miniconda/bin/activate cadquery
6060
- conda install -c conda-forge -c defaults -c cadquery python=$PYTHON_VERSION mypy
61-
- pip install git+https://github.com/CadQuery/OCP-stubs.git@7.4.0
61+
- pip install git+https://github.com/CadQuery/OCP-stubs.git@7.5.1
6262

6363
install:
6464
- python setup.py install

cadquery/occ_impl/assembly.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from OCP.TDocStd import TDocStd_Document
55
from OCP.TCollection import TCollection_ExtendedString
66
from OCP.XCAFDoc import XCAFDoc_DocumentTool, XCAFDoc_ColorType
7+
from OCP.XCAFApp import XCAFApp_Application
78
from OCP.TDataStd import TDataStd_Name
89
from OCP.TDF import TDF_Label
910
from OCP.TopLoc import TopLoc_Location
@@ -104,7 +105,11 @@ def toCAF(
104105
) -> Tuple[TDF_Label, TDocStd_Document]:
105106

106107
# prepare a doc
108+
app = XCAFApp_Application.GetApplication_s()
109+
107110
doc = TDocStd_Document(TCollection_ExtendedString("XmlOcaf"))
111+
app.InitDocument(doc)
112+
108113
tool = XCAFDoc_DocumentTool.ShapeTool_s(doc.Main())
109114
tool.SetAutoNaming_s(False)
110115
ctool = XCAFDoc_DocumentTool.ColorTool_s(doc.Main())

cadquery/occ_impl/shapes.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,16 @@
158158

159159
from OCP.Font import (
160160
Font_FontMgr,
161-
Font_BRepTextBuilder,
162161
Font_FA_Regular,
163162
Font_FA_Italic,
164163
Font_FA_Bold,
165164
Font_SystemFont,
166165
)
167166

167+
from OCP.StdPrs import StdPrs_BRepFont, StdPrs_BRepTextBuilder as Font_BRepTextBuilder
168+
169+
from OCP.NCollection import NCollection_Utf8String
170+
168171
from OCP.BRepFeat import BRepFeat_MakeDPrism
169172

170173
from OCP.BRepClass3d import BRepClass3d_SolidClassifier
@@ -2796,9 +2799,10 @@ def makeText(
27962799
font_t = mgr.FindFont(TCollection_AsciiString(font), font_kind)
27972800

27982801
builder = Font_BRepTextBuilder()
2799-
text_flat = Shape(
2800-
builder.Perform(font_t.FontName().ToCString(), size, font_kind, text)
2802+
font_i = StdPrs_BRepFont(
2803+
NCollection_Utf8String(font_t.FontName().ToCString()), font_kind, size
28012804
)
2805+
text_flat = Shape(builder.Perform(font_i, NCollection_Utf8String(text)))
28022806

28032807
bb = text_flat.BoundingBox()
28042808

conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ requirements:
1515
- setuptools
1616
run:
1717
- python {{ environ.get('PYTHON_VERSION') }}
18-
- ocp 7.4
18+
- ocp 7.5
1919
- pyparsing 2.*
2020
- ezdxf
2121
- ipython

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ channels:
66
dependencies:
77
- python>=3.6
88
- ipython
9-
- ocp=7.4
9+
- ocp=7.5
1010
- pyparsing
1111
- sphinx=3.2.1
1212
- sphinx_rtd_theme

tests/test_cadquery.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3655,7 +3655,7 @@ def test_interpPlate(self):
36553655
surface_points = [[-3.0, -3.0, -3.0], [3.0, 3.0, 3.0]]
36563656
plate_1 = Workplane("XY").interpPlate(edge_wire, surface_points, thickness)
36573657
self.assertTrue(plate_1.val().isValid())
3658-
self.assertAlmostEqual(plate_1.val().Volume(), 26.124970206, 3)
3658+
self.assertAlmostEqual(plate_1.val().Volume(), 26.124970206, 2)
36593659

36603660
# Embossed star, need to change optional parameters to obtain nice looking result.
36613661
r1 = 3.0
@@ -3787,7 +3787,7 @@ def test_interpPlate(self):
37873787
surface_points = [[0, 0, 0]]
37883788
plate_4 = Workplane("XY").interpPlate(edge_wire, surface_points, thickness)
37893789
self.assertTrue(plate_4.val().isValid())
3790-
self.assertAlmostEqual(plate_4.val().Volume(), 7.760559490, 3)
3790+
self.assertAlmostEqual(plate_4.val().Volume(), 7.760559490, 2)
37913791

37923792
def testTangentArcToPoint(self):
37933793

0 commit comments

Comments
 (0)