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!
User avatar
Chris_G
Posts: 1141
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Postby Chris_G » Mon Feb 25, 2019 2:26 pm

- select a control point AND an external shape (with control key)
- press s to attach the control point to the shape
- control point color will change to :
* white when attached to a vertex
* cyan when attached to an edge
* magenta when attached to a face

To free the control point from the shape, select only the control point and press s
m.cavallerin
Posts: 81
Joined: Wed May 30, 2018 6:59 pm

Re: Curves workbench

Postby m.cavallerin » Fri Mar 01, 2019 2:27 am

Hi,

thx for this WB. it's awesome.

I have several questions:

- what is the final goal of "make parametric solid" command?
- on several given air foils profiles, in your opinion, is it better to use the pipeShell or the sweep profiles on 2 rails command? what are the main differences on usage?
Thanks

Michele
User avatar
Chris_G
Posts: 1141
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Postby Chris_G » Fri Mar 01, 2019 10:15 am

m.cavallerin wrote:
Fri Mar 01, 2019 2:27 am
- what is the final goal of "make parametric solid" command?
Hello,
This can be useful when building objects from the ground up, starting from edges and faces.
You'll need solids for boolean operations, for example.
With Part_ShapeBuilder, it is needed to build a shell from faces first, then a solid from the shell ... and it is not parametric.

m.cavallerin wrote:
Fri Mar 01, 2019 2:27 am
- on several given air foils profiles, in your opinion, is it better to use the pipeShell or the sweep profiles on 2 rails command? what are the main differences on usage?
I don't like OCC's Pipeshell, it is rather complicated, it has a bug with auxiliary spline (option "Contact on Border" fails), and it is pretty slow.
"Sweep profiles on 2 rails" is crap (It was one of my attempts at coding a Sweep on 2 rails tool).
If you can get 2 guide curves along your list of profiles, I would recommend to use the Gordon surface tool.
m.cavallerin
Posts: 81
Joined: Wed May 30, 2018 6:59 pm

Re: Curves workbench

Postby m.cavallerin » Sat Mar 02, 2019 2:42 am

Hi and thanks.

I'll look for Gordon.

Michele
m.cavallerin
Posts: 81
Joined: Wed May 30, 2018 6:59 pm

Re: Curves workbench

Postby m.cavallerin » Sat Mar 02, 2019 3:40 am

Hi,

it's just a Draft, but would it be of any help?

Regards.
Attachments
mappingCurvesWB_thread.pdf
(23.37 KiB) Downloaded 39 times
User avatar
hammax
Posts: 866
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee

Re: Curves workbench

Postby hammax » Mon Mar 04, 2019 6:00 pm

… some other Problems:
- What are the new "Reflection Lines" standing for?
- If I use the renewed "Spline through Points" feature, the first thing that appears is the Transform_Feature.
Selecting e.g. the corners of a cube I get a splinecurve (red) named "GordonProfile", which I can manipulate with transform.
But the transform-feature cannot be hidden again or deselected and does only work on the gordon_profile.
(MS Win10_32, FC.18.16028)
Creating an alternative curve through points (green) for comparison works with the usual parameters.
GordonProf.PNG
GordonProf.PNG (67.77 KiB) Viewed 400 times
User avatar
Chris_G
Posts: 1141
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Postby Chris_G » Mon Mar 04, 2019 6:17 pm

hammax wrote:
Mon Mar 04, 2019 6:00 pm
- What are the new "Reflection Lines" standing for?
https://forum.freecadweb.org/viewtopic.php?f=13&t=24660
hammax wrote:
Mon Mar 04, 2019 6:00 pm
- If I use the renewed "Spline through Points" feature, the first thing that appears is the Transform_Feature.
Selecting e.g. the corners of a cube I get a splinecurve (red) named "GordonProfile", which I can manipulate with transform.
But the transform-feature cannot be hidden again or deselected and does only work on the gordon_profile.
(MS Win10_32, FC.18.16028)
I experienced that also, when the editor fails.
This is probably a problem with coin.
Do you get some messages in the report view ?
m.cavallerin
Posts: 81
Joined: Wed May 30, 2018 6:59 pm

Re: Curves workbench

Postby m.cavallerin » Mon Mar 04, 2019 9:10 pm

Hi,

For my purposes, I choose to use sweep2Rails.
I would like to automate the creation of surface by using seweep2Rails command + approximate points on Nurbs.
Assuming I already got a selection (list) of elements: profiles and ruled surface,how can I use s2rCommand class from an external python script?

Thx
User avatar
Chris_G
Posts: 1141
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Postby Chris_G » Mon Mar 04, 2019 9:46 pm

Here is a rough example, it is a copy/paste from the FeaturePython's execute(), it won't work as-is:

Code: Select all

import libS2R
s2r = libS2R.SweepOn2Rails()
s2r.extend = obj.Extend
s2r.profileSamples = obj.ProfileSamples
s2r.railSamples = obj.RailSamples

s2r.setRails(obj.Birail.Shape.Face1)
s2r.setProfiles(self.setProfiles(obj.Profiles)) #((e1,e2,e3))
s2r.build()
#s2r.showLocalProfiles()
#s2r.showInterpoCurves()
s2r.mix(obj.Blending)
#s2r.show()
obj.Points = s2r.downgradeArray()
obj.Shape = s2r.shapeCloud()
return(s2r)
m.cavallerin
Posts: 81
Joined: Wed May 30, 2018 6:59 pm

Re: Curves workbench

Postby m.cavallerin » Tue Mar 05, 2019 5:35 am

Hi and thx,

your hint as been of help.

So I started to edit the s2rCommand class with following:

Code: Select all

class s2rCommand:
    def parseSel(self, selectionObject):
        birail = None
        profs = []
        for obj in selectionObject:
            if hasattr(obj,"NormalizeBinormal") or hasattr(obj,"Orientation"): #if isinstance(obj.Proxy, birail):
                birail = obj
            else:
                profs.append(obj)
        return((birail,profs))

    def inputList(self, List):
        if List == []:
            FreeCAD.Console.PrintError("List is empty\n")
            return
        self.Execute(List)

    def Activated(self):
        s = FreeCADGui.Selection.getSelection()
        if s == []:
            FreeCAD.Console.PrintError("Select a ruled surface and a list of profile edges\n")
            return
        self.Execute(s)
	
    def Execute(self,s):            
        myS2R = FreeCAD.ActiveDocument.addObject("App::FeaturePython","Sweep 2 rails")
        sweep2rails(myS2R)
        sweep2railsVP(myS2R.ViewObject)

        myS2R.Birail   = self.parseSel(s)[0]
        myS2R.Profiles = self.parseSel(s)[1]
        myS2R.Birail.ViewObject.Visibility = False
        for p in myS2R.Profiles:
            p.ViewObject.Visibility = False

        #myS2R.ViewObject.PointSize = 2.00000
        #myS2R.ViewObject.LineColor = (0.0,0.0,0.7)
        
        FreeCAD.ActiveDocument.recompute()


    def GetResources(self):
        return {'Pixmap' : path_curvesWB_icons+'/sw2r.svg', 'MenuText': 'Sweep2Rails', 'ToolTip': 'Sweep profiles on 2 rails'}

FreeCADGui.addCommand('sw2r', s2rCommand())
With this you have two class methods:
Activated allows a Gui selection of entities
inputList method that allows a script to supply the list of items for sweep2Rail command.

Regards.