Search found 1803 matches

Go to advanced search

by Chris_G
Fri Jul 23, 2021 8:37 am
Forum: Help on using FreeCAD
Topic: Curves workbench weirdness?
Replies: 16
Views: 422

Re: Curves workbench weirdness?

Blend Surface uses some Blend Curves under the hood to build the surface. The number of BlendCurves used is set by the "Samples" property (20, by default). A blend curve uses a scale value at each of its extremities, to determine its shape. In order to reduce computation time, these scale ...
by Chris_G
Fri Jul 23, 2021 6:00 am
Forum: Help on using FreeCAD
Topic: Curves workbench weirdness?
Replies: 16
Views: 422

Re: Curves workbench weirdness?

As you can see one of the surfaces (Blend_Surface005 in the model) produces a lip or bulge near its top edge. Which seems weird to me because the surface above it doesn't do this and it should geometrically be the same, just mirrored. What am I doing wrong? Raise the number of Scale Samples from 3 ...
by Chris_G
Thu Jul 22, 2021 4:11 pm
Forum: Python scripting and macros
Topic: how to cut a wire?
Replies: 11
Views: 284

Re: how to cut a wire?

Would you like to try this : def get_wire(edges, e1, e2): _tmp = edges + [e1] se = Part.sortEdges(_tmp) if len(se) == 1: # e1 is indeed touching previous edges w1 = Part.Wire(se[0]) return w1, e2 else: # e1 is not touching previous edges, let's try with e2 se = Part.sortEdges(edges + [e2]) if len(se...
by Chris_G
Thu Jul 22, 2021 12:25 pm
Forum: Python scripting and macros
Topic: how to cut a wire?
Replies: 11
Views: 284

Re: how to cut a wire?

Oh, OK. The error is here : param = edge.Curve.parameter(pts[0][0]) It uses the whole curve, so it can find parameters that are outside of the edge. So you must test if the param is inside the edge parameter range : ... param = edge.Curve.parameter(pts[0][0]) if param <= edge.FirstParameter or param...
by Chris_G
Thu Jul 22, 2021 9:39 am
Forum: Python scripting and macros
Topic: how to cut a wire?
Replies: 11
Views: 284

Re: how to cut a wire?

onekk wrote: Thu Jul 22, 2021 8:35 am It always time to learn something.
I don't think it is very elegant (trying with e1, then with e2)
onekk wrote: Thu Jul 22, 2021 8:35 am but why append .Edges?
edge.split() returns a wire
by Chris_G
Thu Jul 22, 2021 8:27 am
Forum: Help on using FreeCAD
Topic: Curves workbench
Replies: 997
Views: 128126

Re: Curves workbench

Is there a way to make that GORDON like surface also use G1 G2 for the edges? That would be great, ... but far from simple. The surface WB GORDON does not and compared to the BREP surface tool which has G1 the GORDON produces much cleaner geometry. It would be easier to understand you if you used t...
by Chris_G
Thu Jul 22, 2021 7:48 am
Forum: Help on using FreeCAD
Topic: Curves workbench
Replies: 997
Views: 128126

Re: Curves workbench

GlouGlou wrote: Wed Jul 21, 2021 7:58 pm Any idea to correct this curve to close the gordon? :roll:
Maybe a new feature "CorrectedCurve" with a deltaZ at start and end? :D
Your middle rail is not touching the profile.
Is it the Workbench's job to fix bad input ?
by Chris_G
Wed Jul 21, 2021 9:16 pm
Forum: Python scripting and macros
Topic: how to cut a wire?
Replies: 11
Views: 284

Re: how to cut a wire?

Maybe something like this (code not tested) : def split_wire(wire, line, tol=1e-7): edges = [] for i, edge in enumerate(wire.OrderedEdges): d, pts, info = edge.distToShape(line) if d < tol: # edge is intersected by line param = edge.Curve.parameter(pts[0][0]) e1, e2 = edge.split(param).Edges _tmp = ...
by Chris_G
Wed Jul 21, 2021 3:43 pm
Forum: Python scripting and macros
Topic: BSplineSurface how to script correctly in a solid?
Replies: 8
Views: 290

Re: BSplineSurface how to script correctly in a solid?

Maybe you can try reversing the point list :

Code: Select all

pts.reverse()
by Chris_G
Wed Jul 21, 2021 12:12 pm
Forum: Python scripting and macros
Topic: BSplineSurface how to script correctly in a solid?
Replies: 8
Views: 290

Re: BSplineSurface how to script correctly in a solid?

onekk wrote: Tue Jul 20, 2021 4:13 pm I could generate the pointlist:
...
Hello,
If you have a 2D array of points, you can approximate it with a BSpline surface, like here :
https://github.com/tomate44/CurvesWB/bl ... te.py#L186

Go to advanced search