[SOLVED] Approximate BSpline Surface radius

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
brst
Posts: 87
Joined: Thu Apr 18, 2019 10:11 am
Location: Germany

[SOLVED] Approximate BSpline Surface radius

Post by brst »

Hello,

I want to get the approximate radius of a BSpline surface. My first thought was unwrapping it. Using the smallest bounding box dimension doesn't work if the flattened face orientation isn't parallel to the coodinate system axis, so one could use the minimum Volume BoundingBox from Mesh.
Is there a better way to aquire the radius?
Attachments
BSplines_surface_radius.PNG
BSplines_surface_radius.PNG (10.96 KiB) Viewed 825 times
rounding_bSpline_surface.brep
(302.53 KiB) Downloaded 31 times
Last edited by brst on Tue Jun 18, 2019 1:10 pm, edited 2 times in total.
FreeCAD rookie
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Approximate BSpline Surface radius

Post by wmayer »

What about using the inverse of the minimum and maximum curvature value at a given point?

Code: Select all

s=App.ActiveDocument.ActiveObject.Shape.Face1.Surface
c=s.uIso(0.1)
Part.show(c.toShape())
c.centerOfCurvature(0.5)
c.curvature(0.5)

circle=Part.Circle()
circle.Center=c.centerOfCurvature(0.5)
circle.Radius=1/c.curvature(0.5)

pnt=s.value(0.1,0.5)
Part.show(Part.Vertex(pnt))

sph=Part.Sphere()
sph.Center=circle.Center
sph.Radius=circle.Radius
Part.show(sph.toShape())
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: Approximate BSpline Surface radius

Post by easyw-fc »

you may also have a look at Caliper of Mnaipulator WB
https://forum.freecadweb.org/viewtopic. ... 54#p257476
Image
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Approximate BSpline Surface radius

Post by wandererfan »

brst wrote: Fri Jun 14, 2019 9:24 am I want to get the approxiamte radius of a BSpline surface. My first thought was unwrapping it. Using the smallest bounding box dimension doesn't work if the flattened face orientation isn't parallel to the coodinate system axis, so one could use the minimum Volume BoundingBox from Mesh.
Is there a better way to aquire the radius?
It's about curves, not surfaces, but there might be some hints here: https://forum.freecadweb.org/viewtopic. ... le+bspline
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Approximate BSpline Surface radius

Post by chrisb »

In Path workbench a tesselation with arc is performed, because GCodes know only straight lines and arcs. Perhaps you can use something from there.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
brst
Posts: 87
Joined: Thu Apr 18, 2019 10:11 am
Location: Germany

Re: Approximate BSpline Surface radius

Post by brst »

wmayer wrote: Fri Jun 14, 2019 10:04 am What about using the inverse of the minimum and maximum curvature value at a given point?

Code: Select all

s=App.ActiveDocument.ActiveObject.Shape.Face1.Surface
c=s.uIso(0.1)
Part.show(c.toShape())
c.centerOfCurvature(0.5)
c.curvature(0.5)

circle=Part.Circle()
circle.Center=c.centerOfCurvature(0.5)
circle.Radius=1/c.curvature(0.5)

pnt=s.value(0.1,0.5)
Part.show(Part.Vertex(pnt))

sph=Part.Sphere()
sph.Center=circle.Center
sph.Radius=circle.Radius
Part.show(sph.toShape())
Thanks Werner! That's exactly what i was looking for. I didn't know about uIso.
:D
Attachments
result.PNG
result.PNG (9.11 KiB) Viewed 683 times
FreeCAD rookie
Post Reply