BSplineSurface how to script correctly in a solid?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: BSplineSurface how to script correctly in a solid?

Post by onekk »

Many thanks, I have to study more and catch some of the quirks, so I have to improve very much my mathematics.
curve_geom1.png
curve_geom1.png (17.5 KiB) Viewed 806 times
curves_geom2.png
curves_geom2.png (87.76 KiB) Viewed 806 times
I added as constraints the bspline (with the wire it don't work), plus the boundary lines obtained adding some space at the bspline bounding box.
Plus point constraints, the point that generate the bsplinesurface derived from the bspline and the intersecting lines promoted to bspline using some approximation (they are not portion of ellipse, they are simply some derived height using a proportion to determine the height at fixed point using the interception point between the bspline and the sectioning lines).

I have tried to use your curves workbench, generating the splines and then assigning them by hand, but there are some selection problems.

I have seen gordon surfaces, but I cant generate the "mesh" the intersection curves between the points.


One of the main problems, apart from the starting and ending approximations, are the base that is not following the base spline:

Hope that is possible to see the problem here:
curve_adapt.png
curve_adapt.png (1.98 KiB) Viewed 794 times
I have thought of approximating the start and end part using an interpolation of the "generating circles" and then trace from the "circle center" to a certain number of points some lines curved, generating a "portion of a dome".

But many of these thing lead to more calculations and approximation, so math is involved much more.

So I have to study some more.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: BSplineSurface how to script correctly in a solid?

Post by onekk »

Some news, I've managed to obtain something decent:

Now I have two problems:

- how to obtain a solid from the trimmed surface?
- how to obtain the curve to extend it downward to create the side and the bottom part.

I have obtained the surface trimming it with an extruded and enlarged face, obtained offsetting the base curve and substract the two face, one obtained from the base curve, the other obtained from the offsetted curve.

This is the plane intersecting the surface at a proper height (the surface is slightly enlarged to permit a cut)
cur_surf.png
cur_surf.png (6.3 KiB) Viewed 744 times
This is the surface viewed from bottom with the intersectiong plane:
cur_surf2.png
cur_surf2.png (15.85 KiB) Viewed 744 times
I have in mind to extrude the curve obtained with the intersections and obtain "side faces" then fill the curve to obtain a proper face and then make a shell.

But how to obtain a clean curve at the intersection with the plane?

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
User avatar
Chris_G
Veteran
Posts: 2598
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: BSplineSurface how to script correctly in a solid?

Post by Chris_G »

Hello,
I must admit that I have some difficulties to understand the project as a whole.
I would probably have a better global view of the problem if you could explain what this surface will be used for, and what are your raw data and constraints. Maybe there are better, or other ways to solve the problem.
User avatar
onekk
Veteran
Posts: 6205
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: BSplineSurface how to script correctly in a solid?

Post by onekk »

Sorry and thanks for the patience @Chris_G.

The model was born to be a cover for the box of a "guitar" (not exactly a guitar but another instruments).

So the cover must be "domed" at leas in the start and ending "circles".

More in general the problem is "how to model a curved surface" but the curved is not a spherical, or elliptical but maybe the problem will be more "how to blend some dome together".

I have tried some approach:

1) The "pointlist obtained" intersecting some lines to the "base curve" to obtain the start point and the end point and calculate some "intermediate" heights to create the "skeleton of bsplines"

2) I'have tried to use the directly the "skeleton of bsplines" to create a sweep, but the surface is a mess.

3) I have thought to create the domes (manually obtain the radius and center of the "main circles" at least three) and find a way to "smooth merge" the domes

4) I have thought to create a sweep of a profile along a path and the refine the top surface in another way, but with strangely enough using make2dOffset create some "non continous" curves.

I'm open to any suggestion as the point is how to create curved surface, as the main scope is not urgent.

TIA and Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply