Curves workbench

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
touvenant
Posts: 13
Joined: Fri Jul 12, 2019 7:37 am

Re: Curves workbench

Postby touvenant » Sun May 31, 2020 6:13 pm

Hello Glouglou, thanks for your answer !

The supportPlane is not at the same position on my draw.
As you can see, mine is bottom turn than yours :
SupportPlane bottom turn.PNG
SupportPlane bottom turn.PNG (21.37 KiB) Viewed 395 times
How did you "attach" the supportPlane on the two curves (yellow and purple) ?
What is "vertex" ?

Thanks
nic
Posts: 71
Joined: Thu Apr 18, 2019 1:14 pm
Location: France

Re: Curves workbench

Postby nic » Wed Jun 03, 2020 9:42 am

Hello to the Gordonists!

I hope I won't spoil the thread... let me know if I should open a new one.


Here is my config:

Code: Select all

OS: Ubuntu 20.04 LTS (Regolith:GNOME-Flashback:GNOME/regolith)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21300 +2313 (Git) AppImage
Build type: Release
Branch: LinkStage3
Hash: 0f809d2f8f3b8603c0310ffcfb13869710a0ec48
Python version: 3.7.6
Qt version: 5.12.1
Coin version: 4.0.0
OCC version: 7.4.0
Locale: French/France (fr_FR)

See attached model. I don't understand why gordon fails. My rails_XX and Sketch_YY look connected, but Gordon fails with the following error:

Code: Select all

Traceback (most recent call last):
  File "/home/nic/.FreeCAD/Mod/Curves/gordonFP.py", line 135, in execute
    obj.Shape = gordon.surface().toShape()
  File "/home/nic/.FreeCAD/Mod/Curves/gordon.py", line 313, in surface
    self.perform()
  File "/home/nic/.FreeCAD/Mod/Curves/gordon.py", line 287, in perform
    self.gordon_surf = builder.surface_gordon()
  File "/home/nic/.FreeCAD/Mod/Curves/gordon.py", line 100, in surface_gordon
    self.perform()
  File "/home/nic/.FreeCAD/Mod/Curves/gordon.py", line 97, in perform
    self.create_gordon_surface() #self.profiles, self.guides, self.intersectionParamsU, self.intersectionParamsV)
  File "/home/nic/.FreeCAD/Mod/Curves/gordon.py", line 167, in create_gordon_surface
    surfProfiles = bsa.curvesToSurface(self.profiles, self.intersectionParamsV, makeVClosed)
  File "/home/nic/.FreeCAD/Mod/Curves/BSplineAlgorithms.py", line 312, in curvesToSurface
    interpPointsVDir[cpVIdx] = compatSplines[cpVIdx].getPole(cpUIdx+1)
<class 'Part.OCCError'>: Pole index out of range
Recompute failed! Please check report view.
Attachments
A330-200_debug_gordon.FCStd
(23.06 KiB) Downloaded 5 times
gordon_fails.png
gordon_fails.png (39.24 KiB) Viewed 353 times
User avatar
hammax
Posts: 1134
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee

Re: Curves workbench

Postby hammax » Wed Jun 03, 2020 2:38 pm

… you have a double set of rails : rails_top-bottom. => Separate them.
Also your frames are not so clear and self explaining - and their distance is "irregular".
Missing frames BB, CC, DD ?
Try the same procedure with the frames in a loft and you'll see the problem.
nic
Posts: 71
Joined: Thu Apr 18, 2019 1:14 pm
Location: France

Re: Curves workbench

Postby nic » Wed Jun 03, 2020 3:07 pm

hammax wrote:
Wed Jun 03, 2020 2:38 pm
… you have a double set of rails : rails_top-bottom. => Separate them.
Also your frames are not so clear and self explaining - and their distance is "irregular".
Missing frames BB, CC, DD ?
Try the same procedure with the frames in a loft and you'll see the problem.
Thanks Hammax. I thought double sets were allowed! I'll check that. For the frames, their location are known from existing cross sections, which are not equally spaced, unfortunately
User avatar
Chris_G
Posts: 1346
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Postby Chris_G » Wed Jun 03, 2020 8:44 pm

Hi,
nic wrote:
Wed Jun 03, 2020 3:07 pm
I thought double sets were allowed!
They are.
Mixing rails and profiles inside a single object is forbidden.
But having a single object representing several rails, or several profiles, shouldn't make any problem.
The file doesn't look bad at first sight. I don't know yet where the bug comes from ...
User avatar
hammax
Posts: 1134
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee

Re: Curves workbench

Postby hammax » Thu Jun 04, 2020 7:08 am

… I tried it again - this time with a weird and oblique "frame AA" result.
I did a lot of gordon hulls till now, but that is a new feature.

Debug_Gordon.PNG
Debug_Gordon.PNG (29.61 KiB) Viewed 242 times
Attachments
A330-200_debug_2.FCStd
FC.18.4
(61.32 KiB) Downloaded 8 times
nic
Posts: 71
Joined: Thu Apr 18, 2019 1:14 pm
Location: France

Re: Curves workbench

Postby nic » Thu Jun 04, 2020 8:35 am

Chris_G wrote:
Wed Jun 03, 2020 8:44 pm
Hi,
They are.
Mixing rails and profiles inside a single object is forbidden.
But having a single object representing several rails, or several profiles, shouldn't make any problem.
The file doesn't look bad at first sight. I don't know yet where the bug comes from ...
Thanks to confirm! I managed to solve it by reworking the last two frames sketches (FF and GG). I still don't know what was the problem.
hammax wrote:
Thu Jun 04, 2020 7:08 am
… I tried it again - this time with a weird and oblique "frame AA" result.
I did a lot of gordon hulls till now, but that is a new feature.


Debug_Gordon.PNG
yes, strange. but the loft looks good.

I finally managed to get a precise enough volume by combining Gordon on the AFT part of the sections, and AdditiveLoft for FWD sections
Attachments
A330-200.png
A330-200.png (264.02 KiB) Viewed 216 times
User avatar
GlouGlou
Posts: 2262
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: Curves workbench

Postby GlouGlou » Sat Jun 06, 2020 7:46 am

I'm trying to build a helix on a pipe. But SketchOnSurface scale the sketch and allow only one turn around the pipe. Could be possible to not scale it? (the lenght of the wire will give the number of revolutions).
Thanks.
Attachments
spire.FCStd
(29.03 KiB) Downloaded 4 times
User avatar
Chris_G
Posts: 1346
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Postby Chris_G » Sat Jun 06, 2020 10:23 am

Do you need a parametric document object ?
Here is a function that creates a simple helix shape :

Code: Select all

def helix_on_face(face, turns=1.0, wire_output=True):
    """
    Create an helix shape on a periodic face.
    helix_shape = helix_on_face(face, turns=1.0, wire_output=True)
    If wire_output is False, helix_shape will be a single edge.
    However, for a high number of turns, OCCT may fail and return some weird result.
    If wire_output is True, helix_shape will be a wire made of single turn edges.
    """
    u0,u1,v0,v1 = face.ParameterRange
    if face.Surface.isUPeriodic():
        ls = Part.Geom2d.Line2dSegment(FreeCAD.Base.Vector2d(u0, v0), FreeCAD.Base.Vector2d(u0 + ((u1-u0) * turns), v1))
    elif face.Surface.isVPeriodic():
        ls = Part.Geom2d.Line2dSegment(FreeCAD.Base.Vector2d(u0, v0), FreeCAD.Base.Vector2d(u1, v0 + ((v1-v0) * turns)))
    else:
        print("Error: Face is not periodic")
        return None
    if not wire_output:
        return ls.toShape(face.Surface)
    pts = ls.discretize(Distance=ls.length()/turns)
    edges = []
    for i in range(len(pts)-1):
        edges.append(Part.Geom2d.Line2dSegment(pts[i], pts[i+1]).toShape(face.Surface))
    return Part.Wire(edges)

User avatar
hammax
Posts: 1134
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee

Re: Curves workbench

Postby hammax » Sat Jun 06, 2020 3:49 pm

Hi GlouGlou,
is your intention something like that?
Done with CurvesWB and attachment.

HelixPipe.PNG
HelixPipe.PNG (38.5 KiB) Viewed 96 times
Attachments
HelixPipe.FCStd
(96.64 KiB) Downloaded 2 times