Difficulty computing the surface area of a quartic triangle Bezier patch.

32 views
Skip to first unread message

Davis Vigneault

unread,
Apr 29, 2016, 12:12:41 PM4/29/16
to sympy
All--

I'm a new user of sympy, and have been really impressed by how easy it is to get started.  :-)  However, I recently came across a problem that's been causing sympy to hang, and am not sure whether (a) it is an intractable problem that sympy simply can't solve, (b) there is some hint I could give sympy which would let it proceed, or (c) I just need to let it run for a week.  Specifically, I'm trying to compute the surface area of a quartic triangle Bezier patch.  The way this works is that you have fifteen control points (X, a 15 x 3 matrix) and a corresponding fifteen basis functions (b, a vector length fifteen, in terms of parameters s and t).  The position for a given s and t is given by X^T b.  I'm trying to solve for a general patch, X is a matrix of yet unknown constants.  The surface area can be found by evaluating a pretty intense double integral [1], which is what's giving sympy trouble.

I've attached the script I'm using--I'd be infinitely grateful if someone with more experience could offer any advice!

Best, and thanks to everyone who has contributed to this invaluable software!

--Davis

P.S. I've added a guard to the beginning of the script because when I ran this with 0.7.4 (default for Ubuntu 14.04 when installing with apt-get) it resulted in unbounded memory use and crashed my machine--happily, updating to the development branch fixed this.

bezier_surface_area.py

Aaron Meurer

unread,
Apr 29, 2016, 4:15:13 PM4/29/16
to sy...@googlegroups.com
There seem to be some serious performance issues in the polys here. I
was unable to even compute the degree of the polynomial under the
square root.

Do you know if this integral has a closed form? If so, my only
suggestion would be to try some change of variable to make it easier
to compute.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/1488db59-35b6-4fe9-a602-501f304e82b6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages