Curves workbench

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
Chris_G
Veteran
Posts: 2598
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

This is a CurvesWB bug.
No time right now. I'll have a look tomorrow.
drmacro
Veteran
Posts: 8982
Joined: Sun Mar 02, 2014 4:35 pm

Re: Curves workbench

Post by drmacro »

Thanks!
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Chris_G
Veteran
Posts: 2598
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

drmacro wrote: Mon Aug 02, 2021 12:27 pm Not sure if this is my problem, or FC, or Curves...

If you select an edge from a Body that has been transformed (as well as the sketch for the body having an attachment offset) and discretize the edge, it is at the original angle of the sketch offset, but at the original origin of the sketch.
Bug fixed. Thanks.
Zoltan
Posts: 62
Joined: Wed Jul 07, 2021 10:08 am

Re: Curves workbench

Post by Zoltan »

Dear @Chris_G,

How can I use the Curves workbench from Python? I would like to import the interpolate module.

Thank you,
Zoltan
User avatar
Chris_G
Veteran
Posts: 2598
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

Zoltan wrote: Fri Aug 06, 2021 9:28 pm How can I use the Curves workbench from Python? I would like to import the interpolate module.
Many tools in Curves are mainly Gui upon existing Part API.
So these tools are not supposed to be re-used in other scripts.
The interpolate tool is based on Part.BSplineCurve.interpolate :

Code: Select all

help(Part.BSplineCurve.interpolate)
interpolate(...)
Replaces this B-Spline curve by interpolating a set of points.
The function accepts keywords as arguments.

interpolate(Points = list_of_points)

Optional arguments :

PeriodicFlag = bool (False) : Sets the curve closed or opened.
Tolerance = float (1e-6) : interpolating tolerance

Parameters : knot sequence of the interpolated points.
If not supplied, the function defaults to chord-length parameterization.
If PeriodicFlag == True, one extra parameter must be appended.

EndPoint Tangent constraints :

InitialTangent = vector, FinalTangent = vector
specify tangent vectors for starting and ending points
of the BSpline. Either none, or both must be specified.

Full Tangent constraints :

Tangents = list_of_vectors, TangentFlags = list_of_bools
Both lists must have the same length as Points list.
Tangents specifies the tangent vector of each point in Points list.
TangentFlags (bool) activates or deactivates the corresponding tangent.
These arguments will be ignored if EndPoint Tangents (above) are also defined.

Note : Continuity of the spline defaults to C2. However, if periodic, or tangents
are supplied, the continuity will drop to C1.
Zoltan
Posts: 62
Joined: Wed Jul 07, 2021 10:08 am

Re: Curves workbench

Post by Zoltan »

Many tools in Curves are mainly Gui upon existing Part API.
So these tools are not supposed to be re-used in other scripts.
OK, thank you. In the meantime, I wrote my wrapper around Part.BSplineCurve.interpolate based on the code of your workbench.
User avatar
byteofsoren
Posts: 6
Joined: Tue Dec 29, 2020 11:00 pm

Re: Curves workbench

Post by byteofsoren »

Hi. I think I found a bug.
When I reopen a file that uses rails I get
2021-08-07-151617_449x138_scrot.png
2021-08-07-151617_449x138_scrot.png (23.69 KiB) Viewed 1705 times

Code: Select all

File "/home/magnus/.FreeCAD/Mod/Curves/freecad/Curves/approximate.py", line 204, in execute
    num = len(self.Points)
<class 'AttributeError'>: 'Approximate' object has no attribute 'Points'
15:24:03  Recompute failed! Please check report view.
Hope that this helps.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Curves workbench

Post by Kunda1 »

byteofsoren wrote: Sat Aug 07, 2021 2:26 pm Hi. I think I found a bug.
Please always add your full About info when reporting potential bugs. Hi and welcome to the forum.

Oh yea...are you using the most up to date version of the Curves Workbench? (You can check by going to Addon Manager -> highlighting the Curves WB and clicking update.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
byteofsoren
Posts: 6
Joined: Tue Dec 29, 2020 11:00 pm

Re: Curves workbench

Post by byteofsoren »

Shure was, updated it.
Thank you for your hard work.

/MS
freecad-heini-1
Veteran
Posts: 7790
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Curves workbench

Post by freecad-heini-1 »

Hello Chris,
please be so kind and check the tool reflect Lines. I have a plastic part with bevels and rounded edges and would like to have the silhoette edge from the radii for the parting surface of mould inserts. Reflect Lines produces a curve, but it is not at the geometry but far outside.
I am enclosing a sample file for you.
Many greetings, Wilfried
Reflect_Lines_wrong_result.FCStd
(217.49 KiB) Downloaded 50 times

Code: Select all

OS: Ubuntu 18.04.5 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: a0d860679ef6c932e2997d712210e2832f7ebb65
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.5.2
Locale: German/Germany (de_DE)
Post Reply