keithsloan52 wrote: ↑Sat Sep 19, 2020 7:54 pm
I have some code that is getting the error
Code: Select all
<class 'Part.OCCError'>: Geom_RectangularTrimmedSurface::V1==V2
...
I have also noticed this error while importing SVGs.
I've been modifying the SVG code of Draft and testing by exporting and importing. At some point I started getting this error on import, so I was unsure if it was something I did. But the error seems to come from Part.
This example creates a cube that is rotated, and exported to SVG (it is projected on the XY plane).
Code: Select all
import FreeCAD as App
import importSVG
doc = App.newDocument()
feat = doc.addObject("Part::Box", "Box")
feat.Length = 14
feat.Width = 8
feat.Height = 6
feat.Placement.Base = App.Vector(10, 80, 0)
feat.Placement.Rotation = App.Rotation (0.0, -0.2756, 0.0, 0.9612)
doc.recompute()
importSVG.export([feat], "/home/vocx/result.svg")
Then we import the resulting SVG.
Code: Select all
importSVG.open("/home/vocx/result.svg")
Error message
Code: Select all
File "<string>", line 1, in <module>
File "/opt/freecad-build-main/Mod/Draft/importSVG.py", line 1744, in open
parser.parse(f)
File "/usr/lib/python3.6/xml/sax/expatreader.py", line 111, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python3.6/xml/sax/xmlreader.py", line 125, in parse
self.feed(buffer)
File "/usr/lib/python3.6/xml/sax/expatreader.py", line 217, in feed
self._parser.Parse(data, isFinal)
File "../Modules/pyexpat.c", line 419, in StartElement
File "/usr/lib/python3.6/xml/sax/expatreader.py", line 333, in start_element
self._cont_handler.startElement(name, AttributesImpl(attrs))
File "/opt/freecad-build-main/Mod/Draft/importSVG.py", line 1194, in startElement
sh = self.applyTrans(sh)
File "/opt/freecad-build-main/Mod/Draft/importSVG.py", line 1537, in applyTrans
sh = sh.transformGeometry(transform)
<class 'Part.OCCError'>: Geom_RectangularTrimmedSurface::V1==V2
The error occurs inside the importSVG module when using
Part.Shape.transformGeometry.
https://github.com/FreeCAD/FreeCAD/blob ... 1527-L1538
Code: Select all
for transform in self.grouptransform[::-1]:
_msg("applying group transform: {}".format(transform))
# sh = transformCopyShape(sh, transform)
# see issue #2062
sh = sh.transformGeometry(transform)
Here
transform contains a transformation matrix.
If the cube is just displaced the message is
Code: Select all
Part.OCCError: Geom_RectangularTrimmedSurface::U1==U2
If the cube is just rotated the message is
Code: Select all
Part.OCCError: Geom_RectangularTrimmedSurface::V1==V2
https://github.com/FreeCAD/FreeCAD/blob ... 1381-L1397
https://github.com/FreeCAD/FreeCAD/blob ... 3012-L3034
Code: Select all
OS: Ubuntu 18.04.5 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22474 (Git)
Build type: Release
Branch: master
Hash: a44f8ffd427fa9b23b1f00dbf62d66cd152cd774
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)