Search found 1161 matches

Go to advanced search

by Chris_G
Wed Dec 04, 2019 3:10 pm
Forum: Developers corner
Topic: Adding new OCCT classes to FreeCAD python
Replies: 15
Views: 566

Re: Adding new OCCT classes to FreeCAD python

Yes it is.
If I had seen this 2 weeks ago, I would have tried with PythonOCC first, probably.
Thanks
by Chris_G
Tue Dec 03, 2019 12:46 pm
Forum: Python scripting and macros
Topic: pivy: coin.SoNurbsCurve: Couldn't create GLX context
Replies: 9
Views: 230

Re: pivy: coin.SoNurbsCurve: Couldn't create GLX context

No, I just did a couple of experiments, but didn't go any further.
by Chris_G
Mon Dec 02, 2019 9:42 pm
Forum: Python scripting and macros
Topic: pivy: coin.SoNurbsCurve: Couldn't create GLX context
Replies: 9
Views: 230

Re: pivy: coin.SoNurbsCurve: Couldn't create GLX context

I don't remember where I read that, but the rational coordinates in coin must be "pre-multiplied" by the weight : rational_vec = (x*w, y*w, z*w, w) import numpy as np import FreeCAD as app import FreeCADGui as gui import Part as part app.newDocument() array = np.array( [[0. , 0. , 0.01, 0.07, 0.18, ...
by Chris_G
Fri Nov 29, 2019 10:54 am
Forum: Open discussion
Topic: Curves workbench
Replies: 517
Views: 51088

Re: Curves workbench

Thank you Chris. That is new to me. The editable interpolation curve work, blend curve not: Of course, the blend curve still needs 2 edges as input (not vertexes), but you can then set the parameters to the end of the input edges, and set the continuities to C0. Also, please not that the editable i...
by Chris_G
Fri Nov 29, 2019 8:46 am
Forum: Open discussion
Topic: Curves workbench
Replies: 517
Views: 51088

Re: Curves workbench

I just restored it.
But I wonder why you would need it ?
The "editable interpolation curve" and the "blend curve" should both be able to create a straight segment (even though they will be degree 1 BSpline curves instead of real line segment).
by Chris_G
Thu Nov 28, 2019 1:08 pm
Forum: Developers corner
Topic: Adding new OCCT classes to FreeCAD python
Replies: 15
Views: 566

Re: Adding new OCCT classes to FreeCAD python

wmayer wrote:
Thu Nov 28, 2019 1:05 pm
Yes, you're right. At the moment we have only one of the BRepOffset classes exposed to Python but if we do more of them we should think about making packages to make it more Pythonic.
So, I suppose I should take Geom2d as model for Approximation.
by Chris_G
Thu Nov 28, 2019 1:04 pm
Forum: Developers corner
Topic: Adding new OCCT classes to FreeCAD python
Replies: 15
Views: 566

Re: Adding new OCCT classes to FreeCAD python

Thanks to all for the help.
Ickby, I agree.
Some of the occt naming is not very meaningful.
And I don't like the AppDef name neither.
"Approximation" would be way better.
by Chris_G
Wed Nov 27, 2019 6:31 pm
Forum: Developers corner
Topic: Adding new OCCT classes to FreeCAD python
Replies: 15
Views: 566

Re: Adding new OCCT classes to FreeCAD python

Thanks. This is very instructive and puts some light on how FreeCAD works.
I think I will stick to the FreeCAD way, and make a AppDef.h / AppDef.cpp for the pure C++ objects.
by Chris_G
Wed Nov 27, 2019 5:20 pm
Forum: Developers corner
Topic: Adding new OCCT classes to FreeCAD python
Replies: 15
Views: 566

Re: Adding new OCCT classes to FreeCAD python

Thanks Victor,
I add another error first, but it seems to be compiling fine this way :

Code: Select all

AppDef_MultiPointConstraint *mpc = static_cast<Part::AppDef_MultiPointConstraintPy*>(obj)->getAppDef_MultiPointConstraintPtr();
this->getAppDef_MultiLinePtr()->SetValue(idx, *mpc);
by Chris_G
Wed Nov 27, 2019 4:29 pm
Forum: Developers corner
Topic: Adding new OCCT classes to FreeCAD python
Replies: 15
Views: 566

Re: Adding new OCCT classes to FreeCAD python

What error exactly are you getting with the commented-out lines in your PyImp? I get the same error as the one I get with setValue() : error: ‘PyObject {aka struct _object}’ has no member named ‘getAppDef_MultiPointConstraintPtr’ What I don't understand, is that this same function is correctly comp...

Go to advanced search