Extend a Surface both in u and v directions

87 views
Skip to first unread message

Gabriella d' Albenzio

unread,
Oct 28, 2022, 9:53:30 AM10/28/22
to NURBS-Python

Dear Onru,

Thank you so much for sharing this amazing python package! I successfully created a bicubic Bézier surface for planning liver resection using your surface fitting methods. 

However, this surface has to be improved since its boundaries do not reach the outer extremities of liver’s the 3D model. I would like to extend the surface both in u and v directions. What I am looking for is to extrapolate to maintain G1 continuity with the current shape of the surface in both u and v direction.I was thinking to implement the following method:

new_surface = extend_surface(distance, directions, method )

""" Extends a surface maintaining its natural shape

:param distance: fraction of the surface length in the direction of  u and/or v curves runs

:param: directions: u and/or v directions

:method: maintain G1 continuity (it could be also possible to specify a different geometric continuity) 

:return: Bézier Surface

"""”” 

Do you think it is possible to implement it using the geomdl package? If yes, could you give advice on how I could proceed?

I am really open to any feedback and please let me know if I was clear enough in stating my problem. I could also share a screenshot of my preliminary results if requested.

Onur Bingol

unread,
Nov 19, 2022, 4:29:45 PM11/19/22
to nurbs-python
Hey Gabriella,

For some reason, I got blocked on this list. Apologizes for the late response.

At its current state, geomdl doesn't have support for surface extension in the way you are expecting. There are helper functions that you might need to compute derivatives in the helpers module but I believe you might end up needing more.

I am not 100% clear why there is a problem of reaching to the other extremities of the liver model. Fitting depends on the input data points and maybe you need more data points. It is hard to comment on that, but I'd suggest checking it again.

As far as I understand, you would like to input a Bezier patch, extend it in the selected directions and get a Bezier patch. I am not worried about the input, but the output might not be a Bezier patch but a B-Spline surface. Of course, Bezier patches are subsets of B-spline surfaces, but they have some specific rules, e.g. the knot vector, number of control points, etc. What I mean is that the output of the algorithm might not 100% fit to the Bezier surface rules but it would definitely need to fit B-spline surface rules, e.g. you might end up getting more control points.

Second thing is that you might need to use unclamped knot vectors and the fitting algorithms included in the geomdl package might not be suitable for unclamped knot vectors (it has been a long time, but I don't remember experimenting with them). Depending on the level continuity you require, you might want to modify the knot vector a bit.

Sorry I couldn't help more. Best of luck!

-Onur




---- On Fri, 28 Oct 2022 06:53:30 -0700 Gabriella d' Albenzio <dalbenzio...@gmail.com> wrote ---

--
You received this message because you are subscribed to the Google Groups "NURBS-Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nurbs-python...@googlegroups.com.


Gabriella d' Albenzio

unread,
Dec 9, 2022, 10:17:24 AM12/9/22
to NURBS-Python
Hey Onur,

Actually your comment was really helpful and based on that I managed to find a temporary solution, even thought it may be not mathematically correct.

The problem with planning liver resection is that the 3D models of vessel territories may occlude the Bézier surface, so that I need a surface which can slightly exceed the liver surface. I used the code in the attached file for generating new end control points for one Bézier curve.

I will definitely explore B-Spline surfaces and unclamped knot vectors and keep you posted if I ended up finding a better solution.

Thank you for your precious help!
Gabriella
curve_points.csv
Figure_2.png
curve_extension.py

Andras Lasso

unread,
Dec 10, 2022, 11:06:33 AM12/10/22
to nurbs-...@googlegroups.com
Gabriella, 

You might check out the Alive project (http://alive-research.no/about.html), which provides Bezier surface based interactive planning and visualization tools for liver resection.

All the tools are free, restriction-free open-source software that can be used in combination with NURBS-Python (we use the combination of NURBS-Python and VTK for heart valve leaflet modelling). 

Andras




From: Gabriella d' Albenzio
Sent: Friday, December 9, 2022 10:17 a.m.
To: NURBS-Python
Subject: Re: [NURBS-Python] Extend a Surface both in u and v directions
Reply all
Reply to author
Forward
0 new messages