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: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

emills2 wrote: Sun Jul 30, 2017 11:28 am damn! are you sure? they look like curvatures of the iso along the surface normal. a curve comb would dance up and down wildly like my first picture above.

i guess i have to take your word for it....but i'm still going to use them anyway! :lol: they look meaningful to me and they react the way i expected them to. except the scale part.
I am not sure of anything !
But here is a screenshot showing a curve combplot ( green ) and the combplot of the corresponding ( Z-extruded ) surface ( blue ) :
comb.jpeg
comb.jpeg (18.44 KiB) Viewed 7176 times
I know why the sign of the blue plot is wrong.
I need to rework all this.
User avatar
hammax
Veteran
Posts: 1985
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: Curves workbench

Post by hammax »

Hi Chris_G,
...I am missing the birail-tool in your CurvesWB. (using your actual update under FC.17.12098, Win8.1-32).
In Github https://github.com/tomate44/CurvesWB there are recent changes.
And you talk about reworking.
Can you tell something about state of the art?
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

hammax wrote: Wed Sep 13, 2017 6:21 am Hi Chris_G,
...I am missing the birail-tool in your CurvesWB. (using your actual update under FC.17.12098, Win8.1-32).
In Github https://github.com/tomate44/CurvesWB there are recent changes.
And you talk about reworking.
Can you tell something about state of the art?
Hi,
The birail tool was removed quite some time ago. It was almost useless.
So, now, the SweepOn2Rails works with a Ruled-Surface ( that connects the 2 rails ) and some profiles.
I didn't change anything on this tool for several weeks, so it should still work the way it used to.
I am lacking free time, so my WB development is paused for now.
User avatar
hammax
Veteran
Posts: 1985
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: Curves workbench

Post by hammax »

...Hi Chris, I'm still experimenting with your CurvesWB.
Actually I tried to apply BSplines (red rectangle) to the endpoints of the frames, to get parametric birails.
That does not work, instead I have to use Draft-Bsplines (snap nearest), which are not linked parametrically to the frames.
Is there a method or a feature (without a macro) to produce a parametric gridlike rectangle mesh, connected to the frames so,
that I can edit the frame-sketcher-splines, to change the hullgeometry in small steps.

One of my trial results was this queered meshconstruction after applying the "edit nurbs"-icon (green rectangle).
Did you ever see such a mess?

Curves_4.PNG
Curves_4.PNG (201.84 KiB) Viewed 7000 times
User avatar
hammax
Veteran
Posts: 1985
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: Curves workbench

Post by hammax »

...avoiding to be misunderstood - I want to do something like the mesh in ViewTab manually and parametric.
Your show grid, frames, points and so on, is a good and usable function , but I can configure it only by number.
(more automatic than I wish to) => therefore I want to do "my own thing" by applying parametric BSplines on points.
The appended picture is a model of some oldie steam launch - showing,that CurvesWB works well
and could be understood.

Curves_5.PNG
Curves_5.PNG (63.67 KiB) Viewed 6955 times
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

hammax wrote: Mon Oct 02, 2017 5:13 pm ...Hi Chris, I'm still experimenting with your CurvesWB.
Actually I tried to apply BSplines (red rectangle) to the endpoints of the frames, to get parametric birails.
That does not work, instead I have to use Draft-Bsplines (snap nearest), which are not linked parametrically to the frames.
Is there a method or a feature (without a macro) to produce a parametric gridlike rectangle mesh, connected to the frames so,
that I can edit the frame-sketcher-splines, to change the hullgeometry in small steps.
Hi,
Not sure to understand.
You'd like to have a SweepOn2Rails object, and edit the profiles (or the rails) while there endpoints stay parametrically clamped on the rails ?
if yes, that is something I have in mind for some time. But I lack free time.
So I am afraid it is not possible right now.
hammax wrote: Mon Oct 02, 2017 5:13 pm One of my trial results was this queered meshconstruction after applying the "edit nurbs"-icon (green rectangle).
Did you ever see such a mess?
This looks like the display of the surfaceEdit tool.
Do you have a "Surface Edit Tool" tab in the combo view ?
surfedit.jpeg
surfedit.jpeg (61.74 KiB) Viewed 6947 times
User avatar
hammax
Veteran
Posts: 1985
Joined: Thu Jan 19, 2017 5:03 pm
Location: Ammersee DE

Re: Curves workbench

Post by hammax »

...yes I want to edit the profiles. Actually I do it only inside the sketcher-splines.
If I change a profile-endpoint, I have to delete the rail and draw a new one, because there is some gap.
Problem is, that I can only use Draft-Bsplines for the rails, which are not parametrically clamped to the endpoints of the profiles.
I thought you had foreseen the possibility to use BSplines in curvesWB. But the first Icon (spline on points) does not work. After selecting a second point FreeCAD freezes.
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Curves workbench

Post by easyw-fc »

Hi Chris,
I'm trying to get a Sketch of an Edge which is a BSpline...
What I can do now is to create a Sketch which is approximating the bspline with arcs... this is in fact quite useful and it covers a mine user case to push the edge to kicad board (which doesn't accept bspline, but only arcs and lines).
https://forum.freecadweb.org/viewtopic.php?f=9&t=25082

I tried to see if in your Curves WB I could convert a spline edge to a Sketch, conserving the spline function, but I couldn't find a way to do it.
bspline-edge.FCStd
(2.49 KiB) Downloaded 135 times
Would you have some suggestions or some code tips?

Thanks in advance for any suggestion...
Maurice
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Curves workbench

Post by Chris_G »

easyw-fc wrote: Sat Oct 28, 2017 8:12 pm Would you have some suggestions or some code tips?

Thanks in advance for any suggestion...
Maurice
Hi Maurice,
I don't use the sketcher a lot, so I don't know much about sketcher scripting.
I gave a try at the conversion, with no success.
Here is what I tried :

Code: Select all

edge = FreeCADGui.Selection.getSelection()[0].Shape.Edges[0]

# create the list of circles (control points)
circles = []
for pole in edge.Curve.getPoles():
    circles.append(Part.Circle(pole,App.Vector(0,0,1),10))


sk = App.activeDocument().addObject('Sketcher::SketchObject','Sketch')

# add the circles to the sketch, as construction geometries
for c in circles:
    sk.addGeometry(c, True)

# set the radius of the first circle to 10
sk.addConstraint(Sketcher.Constraint('Radius',0,10.000000)) 

# set the constraints of the following circles
w = edge.Curve.getWeights()
for i in range(1,len(circles)):
    if w[i] == w[0]:
        sk.addConstraint(Sketcher.Constraint('Equal',0,i))
    else:
        sk.addConstraint(Sketcher.Constraint('Radius',i,10.0 * w[i] / w[0])) 

# add the BSplineCurve to the sketch
sk.addGeometry(edge.Curve, False)

# below should be the "glue" code between the circles and the BSplineCurve
conList = []
for i range(len(circles)):
    # I don't know the meaning of the numbers at the end of the following command
    conList.append(Sketcher.Constraint('InternalAlignment:Sketcher::BSplineControlPoint',i,3,len(circles),i))

App.ActiveDocument.Sketch.addConstraint(conList)

# the following line fails, I don't know why
App.ActiveDocument.Sketch.exposeInternalGeometry(len(conList))
 
# and in the resulting sketch, the circles have no effect on the curve shape ...

User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Curves workbench

Post by easyw-fc »

Chris_G wrote: Sun Oct 29, 2017 10:48 am Hi Maurice,
I don't use the sketcher a lot, so I don't know much about sketcher scripting.
I gave a try at the conversion, with no success.
Here is what I tried :
...
Hi Chris,
this seems the right way to achieve the Sketcher...
I noticed that if you add a 'Coincident' constraint between first circle center point and first bspline point and last circle center point and last bspline point, the Sketcher get connected with the first and last construction circles...
(I did it manually in the result sketcher)
So now what is missing is a way to make Coincident the middle circle centers to the correspondent point of green curve...
Is there a way to retrieve those points? (I moved the circle to display the green reference point)
bspline-sk1.png
bspline-sk1.png (206.77 KiB) Viewed 6771 times
thanks to go into this :D
Maurice

EDIT I wouldn't like to hijack your original thread... if you prefer we can move this conversation to this topic...
https://forum.freecadweb.org/viewtopic. ... 54#p197154
Feel free to reply here or there as you prefer
thx again M
Post Reply