Bezier Triangle

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
emills
Posts: 36
Joined: Fri Jan 06, 2012 3:17 am

Re: Bezier Triangle

Post by emills »

haven't had a chance to try your code yet, but i was wondering if you could tell me if it performs better than the picture below. I got that far, then shook my fist angrily at the nurbs gods!

there are two pictures. the first one is the control mesh and automatically derived smoothed edges
lumpy mesh.JPG
lumpy mesh.JPG (44.25 KiB) Viewed 1629 times
the second is the result i got with the "three nurbs patches arranged in a triangle".....exactly like your sketch. except i can't figure out how to load two attachments :) lol. see next post for other pic
emills
Posts: 36
Joined: Fri Jan 06, 2012 3:17 am

Re: Bezier Triangle

Post by emills »

the other pic
lumpy surface.JPG
lumpy surface.JPG (43.25 KiB) Viewed 1629 times
anyway..i gave up after that. for now. i plan to come back with a full subdivision triangle nurbing scheme...in 10 years :)
NateM
Posts: 107
Joined: Sat Nov 16, 2013 5:43 pm

Re: Bezier Triangle

Post by NateM »

emills,

My script basically works by sweeping one curve to another with the connecting wires as the rails. A triangular patch is represented as a quad with one side of length 0 represented as n number of the same point. I have found it works pretty well on a few test cases that I used though I'm sure there is a better algorithm out there. I am not sure exactly what that would be however. One additional thought I had would be to sweep in one direction and then in the other and then average the results which should be a pretty good fit. I will have to try that when I have time. If the best way forward seems to be developing a numerical minimization technique I am worried about getting caught in a local minima because of the number of degrees of freedom (which I suspect is the problem that the built in surfacing tool is having) and determining exactly what the right error function is.

The biggest limitation of my script, as I see it, is that you need to have the points in the given curve defined and can't use edge objects in FreeCAD directly. As far as I am aware, a Part.Shape object does not store the points required to generate that curve but maybe I just haven't found that yet. Is it possible to retrieve these points easily?

As an aside, I believe that the pole generation part of the algorithm should work with bsplines as well though I haven't tested it.
Post Reply