question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OCC compatibility TODO list

See original GitHub issue

I’m opening this issue as a TODO list of what else needs to be done on the feature/freecad-occ branch to finish up compatibility with the pythonOCC fork of cadquery. The initial list is just the result of running the test suite and seeing what breaks. See the test.log attached here.

======================================================================
FAIL: test_parent (t_cqparts.test_params.ComponentRefTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/justinbuchanan/src/github/cq/cqparts/tests/t_cqparts/test_params.py", line 396, in test_parent
    self.assertAlmostEqual(bb.xmin, -1)
AssertionError: -1.01 != -1 within 7 places
======================================================================
FAIL: test_multipart_assembly (t_cqparts.test_codecs.TestStep)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/justinbuchanan/src/github/cq/cqparts/tests/t_cqparts/test_codecs.py", line 238, in test_multipart_assembly
    self.assertEqual(len(thing.components), 2)
AssertionError: 1 != 2
  • Some tests reference cadquery.freecad_impl.console_logging.enable(logging.INFO), which isn’t present in cadquery-occ.

There are likely other issues, but here’s what I’ve seen so far. Please feel free to add to this list. Also, if you’re working on something, please put your name next to the item or comment so we can avoid duplicate work 😃.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
jmwrightcommented, Feb 19, 2020

The tests pass now, but the test related to CadQuery issue #283 is being skipped for now. I have left the display tests which rely on FreeCAD in for now (they’re being skipped), until that functionality can be replaced by CQ-editor or something equivalent. The docs also need to be updated. In any case, cqparts should be usable with CQ 2.0 now, even with all the work that’s left to do for a full transition.

1reaction
jmwrightcommented, Feb 16, 2020

I’m most of the way through an update of cqparts to CQ 2.0. It’s on this fork. It’s built on top of the great work @adam-urbanczyk has been doing to get CadQuery updated to OCCT 7.4.x using auto-generated bindings. There are some nice performance improvements and added features. Just FYI - I do intend to clean up the commented FreeCAD references once everything is working.

@fragmuffin Would you be supportive of merging this into master once it’s been vetted properly and OCCT 7.4 support is mainline in CQ 2.0, or will it need to live on as a branch or fork?

As of this writing (and I’m quitting for the night), I have 0 assert failures and 4 errors. It’s only a matter of time before I stamp those last 4 out, but if anybody is interested in taking a look, I’ll post them below. Any other feedback on the changes that have been made are welcome too. If there’s support for merging into master, I’ll put a PR together once the tests run successfully and I have some instructions on how to run my branch against CQ 2.0 and OCCT 7.4.

======================================================================
ERROR: test_nested (t_cqparts.test_assembly.BoundingBoxTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jwright/Downloads/repos/cqparts/tests/t_cqparts/test_assembly.py", line 348, in test_nested
    bb = obj.bounding_box
  File "/home/jwright/Downloads/repos/cqparts/src/cqparts/assembly.py", line 306, in bounding_box
    component.bounding_box for component in self.components.values()
  File "/home/jwright/Downloads/repos/cqparts/src/cqparts/assembly.py", line 306, in <genexpr>
    component.bounding_box for component in self.components.values()
  File "/home/jwright/Downloads/repos/cqparts/src/cqparts/assembly.py", line 306, in bounding_box
    component.bounding_box for component in self.components.values()
  File "/home/jwright/Downloads/repos/cqparts/src/cqparts/utils/geometry.py", line 38, in merge_boundboxes
    wrapped_bb = WrappedType(*(min_params + max_params))
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
    1. OCP.Bnd.Bnd_Box()
    2. OCP.Bnd.Bnd_Box(theMin: OCP.gp.gp_Pnt, theMax: OCP.gp.gp_Pnt)

Invoked with: 15.0, -35.0, -45.0, 55.0, 35.0, -5.0

======================================================================
ERROR: test_single_layer (t_cqparts.test_assembly.BoundingBoxTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jwright/Downloads/repos/cqparts/tests/t_cqparts/test_assembly.py", line 340, in test_single_layer
    bb = obj.bounding_box
  File "/home/jwright/Downloads/repos/cqparts/src/cqparts/assembly.py", line 306, in bounding_box
    component.bounding_box for component in self.components.values()
  File "/home/jwright/Downloads/repos/cqparts/src/cqparts/utils/geometry.py", line 38, in merge_boundboxes
    wrapped_bb = WrappedType(*(min_params + max_params))
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
    1. OCP.Bnd.Bnd_Box()
    2. OCP.Bnd.Bnd_Box(theMin: OCP.gp.gp_Pnt, theMax: OCP.gp.gp_Pnt)

Invoked with: -1.0, -1.0, 0.0, 1.0, 1.0, 3.0

======================================================================
ERROR: test_from_matrix (t_cqparts.test_coordsystem.CoordSystemTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jwright/Downloads/repos/cqparts/tests/t_cqparts/test_coordsystem.py", line 79, in test_from_matrix
    0,0,0,1
TypeError: __init__() takes from 1 to 2 positional arguments but 17 were given

======================================================================
ERROR: test_random_failsafe (t_cqparts.test_coordsystem.CoordSystemTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jwright/anaconda3/envs/pywrap/lib/python3.6/site-packages/mock/mock.py", line 1369, in patched
    return func(*newargs, **newkeywargs)
  File "/home/jwright/Downloads/repos/cqparts/tests/t_cqparts/test_coordsystem.py", line 127, in test_random_failsafe
    cs = CoordSystem.random()
  File "/home/jwright/Downloads/repos/cqparts/src/cqparts/utils/geometry.py", line 211, in random
    normal=rand_vect(-1, 1),
  File "/home/jwright/Downloads/repos/cqparts/src/cqparts/utils/geometry.py", line 50, in __init__
    super(CoordSystem, self).__init__(origin, xDir, normal)
  File "/home/jwright/Downloads/repos/cadquery/cadquery/occ_impl/geom.py", line 472, in __init__
    self._setPlaneDir(xDir)
  File "/home/jwright/Downloads/repos/cadquery/cadquery/occ_impl/geom.py", line 718, in _setPlaneDir
    self.yDir = self.zDir.cross(self.xDir).normalized()
  File "/home/jwright/Downloads/repos/cadquery/cadquery/occ_impl/geom.py", line 122, in normalized
    return Vector(self.wrapped.Normalized())
OCP.Standard.Standard_ConstructionError: gp_Vec::Normalized() - vector has zero norm

----------------------------------------------------------------------
Ran 197 tests in 1.422s

FAILED (errors=4, skipped=4)

Related issues: #98 #144

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrate: FC -> OCC · GitHub
Parametric CAD for coders, a wrapper for cadquery objects. - Migrate: FC -> OCC · cqparts/cqparts.
Read more >
8 best to do list apps of 2023 - Zapier
Best to-do list app for Microsoft power users (and Wunderlist refugees) · Create Workboard action items from new tasks in Microsoft To-Do ·...
Read more >
To Do List and Task Management App | Microsoft To Do
With Microsoft To Do you can easily create and sync your task lists across multiple devices so you have your to do list...
Read more >
Arduino - Home
Open-source electronic prototyping platform enabling users to create interactive electronic objects.
Read more >
chevy impala ac not blowing - Ramozzi & Friends
THE PARTS COMPATIBILITY LIST MThe TPMS sensor matching process is: Set the ... First and easiest thing to do is to check a/c...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found