Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: line surface intersection
Replies: 4   Last Post: Jan 20, 2014 10:22 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 4
Registered: 6/30/12
Re: line surface intersection
Posted: Jan 20, 2014 10:22 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I've been working on this problem for a couple of days - and have a solution below which achieves the correct result.

However I'm looking to make this much more efficient in order to use in animation.

I'd be grateful for any pointers!


"John D'Errico" <woodchips@rochester.rr.com> wrote in message <ighcj0$n28$1@fred.mathworks.com>...
> "Peter Schreiber" <schreiber.peter15@gmail.com> wrote in message <igh7cl$ph8$1@fred.mathworks.com>...
> > Hi guys,
> > I'm trying to find the line surface intersection in following program. For now I can
> > assume that there is one and only one such intersection possible. The code works
> > but I was wondering if anyone has any ideas improving the speed/performance.
> > Is there something that can be vectorized or are there any other ways to improve
> > speed?
> >

> Ugh. Personally, that code looks like it runs like a dog
> with two legs. I would completely rewrite it.
> The idea is to rotate the surface so that the line becomes
> a coordinate axis. This makes the intersection a far more
> trivial one. Then, identify those simplexes which MAY
> possibly intersect the axis in question using either a
> circumsphere or a bounding box. (I don't recall which
> I used.) Now just test each potential simplex more
> accurately.
> I've got some code that I can give out to compute this
> intersection of a general line with any n-manifold. A surface
> would qualify if you have a triangulation for it, and that
> triangulation is trivial to generate for z(x,y). If there are
> multiple points of intersection, all of them are generated.
> A quick check shows that the code I wrote generates the
> point of closest approach if the line fails to intersect the
> manifold at all.
> You can do a large fraction of this in a vectorized form.
> John

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.