Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1230 > unrolled thread

Foot in Mouth. How to do b-splines?

Started byluser- -droog <mijoryx@yahoo.com>
First post2013-01-25 20:09 -0800
Last post2013-02-22 16:50 -0800
Articles 20 — 5 participants

Back to article view | Back to comp.lang.postscript


Contents

  Foot in Mouth. How to do b-splines? luser- -droog <mijoryx@yahoo.com> - 2013-01-25 20:09 -0800
    Re: Foot in Mouth. How to do b-splines? luser- -droog <mijoryx@yahoo.com> - 2013-01-27 22:27 -0800
      Re: Foot in Mouth. How to do b-splines? Ross Presser <rpresser@gmail.com> - 2013-01-28 10:31 -0800
        Re: Foot in Mouth. How to do b-splines? luser- -droog <mijoryx@yahoo.com> - 2013-01-29 00:26 -0800
        Re: Foot in Mouth. How to do b-splines? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2013-01-30 03:55 -0500
          Re: Foot in Mouth. How to do b-splines? luser- -droog <mijoryx@yahoo.com> - 2013-01-30 01:53 -0800
          Re: Foot in Mouth. How to do b-splines? Helge Blischke <h.blischke@acm.org> - 2013-01-30 14:27 +0100
            Re: Foot in Mouth. How to do b-splines? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2013-01-30 19:22 -0500
              Re: Foot in Mouth. How to do b-splines? Ross Presser <rpresser@gmail.com> - 2013-01-30 18:24 -0800
                Re: Foot in Mouth. How to do b-splines? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2013-01-31 21:27 -0500
      Re: Foot in Mouth. How to do b-splines? luser- -droog <mijoryx@yahoo.com> - 2013-01-31 23:48 -0800
    Re: Foot in Mouth. How to do b-splines? Don Lancaster <don@tinaja.com> - 2013-02-09 16:28 -0700
      Re: Foot in Mouth. How to do b-splines? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2013-02-10 00:18 -0500
        Re: Foot in Mouth. How to do b-splines? Don Lancaster <don@tinaja.com> - 2013-02-10 09:47 -0700
          Re: Foot in Mouth. How to do b-splines? tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2013-02-10 19:59 -0500
    Re: Foot in Mouth. How to do b-splines? luser- -droog <mijoryx@yahoo.com> - 2013-02-10 21:47 -0800
      Re: Foot in Mouth. How to do b-splines? luser- -droog <mijoryx@yahoo.com> - 2013-02-11 01:16 -0800
        Re: Foot in Mouth. How to do b-splines? luser- -droog <mijoryx@yahoo.com> - 2013-02-17 17:16 -0800
          Re: Foot in Mouth. How to do b-splines? luser- -droog <mijoryx@yahoo.com> - 2013-02-17 17:20 -0800
            Re: Foot in Mouth. How to do b-splines? luser- -droog <mijoryx@yahoo.com> - 2013-02-22 16:50 -0800

#1230 — Foot in Mouth. How to do b-splines?

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-01-25 20:09 -0800
SubjectFoot in Mouth. How to do b-splines?
Message-ID<56010d14-6c27-4858-a7d0-0c379819b878@googlegroups.com>
I posted this challenge 
http://codegolf.stackexchange.com/q/10559/2381
before fully realizing that I don't know how to do it.

The teapot data is organized into 180-something vertices,
and 32 patches using 16 vertices each.

Wikipedia was no help. too mathy.

[toc] | [next] | [standalone]


#1231

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-01-27 22:27 -0800
Message-ID<d161b347-ec01-4392-bfc8-6be0a39b7ed7@googlegroups.com>
In reply to#1230
On Friday, January 25, 2013 10:09:14 PM UTC-6, luser- -droog wrote:
> I posted this challenge 
> 
> http://codegolf.stackexchange.com/q/10559/2381
> 
> before fully realizing that I don't know how to do it.
> 
> 
> 
> The teapot data is organized into 180-something vertices,
> 
> and 32 patches using 16 vertices each.
> 
> 
> 
> Wikipedia was no help. too mathy.

Conceded defeat. I voted to close the question and invited others do so as well. I moved it to the sandbox where it joins my dozen other not-ready-yet challenges.

[toc] | [prev] | [next] | [standalone]


#1232

FromRoss Presser <rpresser@gmail.com>
Date2013-01-28 10:31 -0800
Message-ID<ea792426-6c0d-4de3-b415-460abc077a58@googlegroups.com>
In reply to#1231
On Monday, January 28, 2013 1:27:10 AM UTC-5, luser- -droog wrote:

> Conceded defeat. I voted to close the question and
> invited others do so as well. I moved it to the sandbox
> where it joins my dozen other not-ready-yet challenges.

Take a look at this:
http://merganser.math.gvsu.edu/david/bezier/ps.html

[toc] | [prev] | [next] | [standalone]


#1233

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-01-29 00:26 -0800
Message-ID<21feb816-caa2-4be8-80ea-9919a3c0d1ff@googlegroups.com>
In reply to#1232
That's awesome!

But, it doesn't seem to help me with the 3D patches.

I've asked for more help on SO. http://stackoverflow.com/q/14558814/733077
One useful discovery is that the data in question is Bezier surface patches, not B-splines.

[toc] | [prev] | [next] | [standalone]


#1234

Fromtlvp <mPiOsUcB.EtLlLvEp@att.net>
Date2013-01-30 03:55 -0500
Message-ID<1s7hus9rcalkk$.rrdzua3zhpzu.dlg@40tude.net>
In reply to#1232
On Mon, 28 Jan 2013 10:31:22 -0800 (PST), Ross Presser wrote:

> Take a look at this:
> http://merganser.math.gvsu.edu/david/bezier/ps.html

Alas, in Safari, at any rate, the following HTML from that page ...

<applet code=PrintBezier width=400 height=600></applet>

... does nothing at all.

And in Firefox, I get "This plugin is disabled", with an option to go
"Manage plugins...", but no hint which plugin (none actually are disabled)
is thought to be the problem.

What am I missing here? TIA; and cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.

[toc] | [prev] | [next] | [standalone]


#1235

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-01-30 01:53 -0800
Message-ID<555c0990-6149-46e9-9c58-83a0d17e8fa1@googlegroups.com>
In reply to#1234
On Wednesday, January 30, 2013 2:55:04 AM UTC-6, tlvp wrote:
> On Mon, 28 Jan 2013 10:31:22 -0800 (PST), Ross Presser wrote:
> 
> 
> 
> > Take a look at this:
> 
> > http://merganser.math.gvsu.edu/david/bezier/ps.html
> 
> 
> 
> Alas, in Safari, at any rate, the following HTML from that page ...
> 
> 
> 
> <applet code=PrintBezier width=400 height=600></applet>
> 
> 
> 
> ... does nothing at all.
> 
> 
> 
> And in Firefox, I get "This plugin is disabled", with an option to go
> 
> "Manage plugins...", but no hint which plugin (none actually are disabled)
> 
> is thought to be the problem.
> 
> 
> 
> What am I missing here? TIA; and cheers, -- tlvp
> 
> -- 
> 
> Avant de repondre, jeter la poubelle, SVP.

It's plain-old Java, I think. I had to fire up Chrome and it prompted to install the plugin.

[toc] | [prev] | [next] | [standalone]


#1236

FromHelge Blischke <h.blischke@acm.org>
Date2013-01-30 14:27 +0100
Message-ID<amsleeFgnakU1@mid.individual.net>
In reply to#1234
tlvp wrote:

> On Mon, 28 Jan 2013 10:31:22 -0800 (PST), Ross Presser wrote:
> 
>> Take a look at this:
>> http://merganser.math.gvsu.edu/david/bezier/ps.html
> 
> Alas, in Safari, at any rate, the following HTML from that page ...
> 
> <applet code=PrintBezier width=400 height=600></applet>
> 
> ... does nothing at all.
> 
> And in Firefox, I get "This plugin is disabled", with an option to go
> "Manage plugins...", but no hint which plugin (none actually are disabled)
> is thought to be the problem.
> 
> What am I missing here? TIA; and cheers, -- tlvp

The latest Firefox obviously disabled plain old Java altogether because of 
security issues.

Helge

[toc] | [prev] | [next] | [standalone]


#1237

Fromtlvp <mPiOsUcB.EtLlLvEp@att.net>
Date2013-01-30 19:22 -0500
Message-ID<6jnwjyjbme6z$.7dq6bvxeqweb$.dlg@40tude.net>
In reply to#1236
On Wed, 30 Jan 2013 14:27:41 +0100, Helge Blischke wrote:

... [answering: What am I missing here?] ...

> The latest Firefox obviously disabled plain old Java altogether because of 
> security issues.
 
Thanks, Helge (and luser). So: am I missing enough that I should reinstall
Java for the sake of seeing this PrintBezier applet? Or just fuggedaboudit?

Cheers, -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.

[toc] | [prev] | [next] | [standalone]


#1238

FromRoss Presser <rpresser@gmail.com>
Date2013-01-30 18:24 -0800
Message-ID<d2750998-ac46-4c2c-9bfb-9c0752a1441e@googlegroups.com>
In reply to#1237
On Wednesday, January 30, 2013 7:22:48 PM UTC-5, tlvp wrote:

> Thanks, Helge (and luser). So: am I missing enough that I should reinstall
> Java for the sake of seeing this PrintBezier applet? Or just fuggedaboudit?

I made a short video of it in operation. I hope you can view flash ...
http://screencast.com/t/Ffe7wusIF

[toc] | [prev] | [next] | [standalone]


#1241

Fromtlvp <mPiOsUcB.EtLlLvEp@att.net>
Date2013-01-31 21:27 -0500
Message-ID<5xej9itjpdou$.10tzdm2e4e4b3.dlg@40tude.net>
In reply to#1238
On Wed, 30 Jan 2013 18:24:08 -0800 (PST), Ross Presser wrote:

> On Wednesday, January 30, 2013 7:22:48 PM UTC-5, tlvp wrote:
> 
>> Thanks, Helge (and luser). So: am I missing enough that I should reinstall
>> Java for the sake of seeing this PrintBezier applet? Or just fuggedaboudit?
> 
> I made a short video of it in operation. I hope you can view flash ...
> http://screencast.com/t/Ffe7wusIF

Many thanks, Ross: "By Jingo", that did it :-) ! Neat. Thanks. Cheers, 

-- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.

[toc] | [prev] | [next] | [standalone]


#1242

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-01-31 23:48 -0800
Message-ID<e0727712-381e-4f11-b9bb-3ba008c625da@googlegroups.com>
In reply to#1231
On Monday, January 28, 2013 12:27:10 AM UTC-6, luser- -droog wrote:
> On Friday, January 25, 2013 10:09:14 PM UTC-6, luser- -droog wrote:
> 
> > I posted this challenge 
> > http://codegolf.stackexchange.com/q/10559/2381
> > before fully realizing that I don't know how to do it.
> 
> > The teapot data is organized into 180-something vertices,
> > and 32 patches using 16 vertices each.
> > Wikipedia was no help. too mathy.
> 
> Conceded defeat. I voted to close the question and invited others do so as well. I moved it to the sandbox where it joins my dozen other not-ready-yet challenges.

Made some progress. Results at:
http://stackoverflow.com/a/14600918/733077

But it turns out backface-culling is useless (and wrong).
I need a BSP.

[toc] | [prev] | [next] | [standalone]


#1251

FromDon Lancaster <don@tinaja.com>
Date2013-02-09 16:28 -0700
Message-ID<ano4cvFoc6cU1@mid.individual.net>
In reply to#1230
On 1/25/2013 9:09 PM, luser- -droog wrote:
> I posted this challenge
> http://codegolf.stackexchange.com/q/10559/2381
> before fully realizing that I don't know how to do it.
>
> The teapot data is organized into 180-something vertices,
> and 32 patches using 16 vertices each.
>
> Wikipedia was no help. too mathy.
>


< http://www.tinaja.com/bcsamp1.shtml > , of course.

-- 
Many thanks,

Don Lancaster                          voice phone: (928)428-4073
Synergetics   3860 West First Street   Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml   email: don@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com

[toc] | [prev] | [next] | [standalone]


#1252

Fromtlvp <mPiOsUcB.EtLlLvEp@att.net>
Date2013-02-10 00:18 -0500
Message-ID<pc4fbhne0354$.1c8peulcjz26i.dlg@40tude.net>
In reply to#1251
On Sat, 09 Feb 2013 16:28:28 -0700, Don Lancaster wrote:

> < http://www.tinaja.com/bcsamp1.shtml > , of course.

Thanks, Don, for a link that would otherwise have been hard to find.

In gratitude, let me offer a tiny typo + correction: in the seventh of the
ten items in your left-hand column, your link-text 

>   Pixed Interpolation Algorithms

surely meant "Pixel" where you have "Pixed", no? 

You're welcome; cheers; and thanks again for that bcsamp page ref., -- tlvp
-- 
Avant de repondre, jeter la poubelle, SVP.

[toc] | [prev] | [next] | [standalone]


#1254

FromDon Lancaster <don@tinaja.com>
Date2013-02-10 09:47 -0700
Message-ID<anq197F6m4vU1@mid.individual.net>
In reply to#1252
On 2/9/2013 10:18 PM, tlvp wrote:
> On Sat, 09 Feb 2013 16:28:28 -0700, Don Lancaster wrote:
>
>> < http://www.tinaja.com/bcsamp1.shtml > , of course.
>
> Thanks, Don, for a link that would otherwise have been hard to find.
>
> In gratitude, let me offer a tiny typo + correction: in the seventh of the
> ten items in your left-hand column, your link-text
>
>>    Pixed Interpolation Algorithms
>
> surely meant "Pixel" where you have "Pixed", no?
>
> You're welcome; cheers; and thanks again for that bcsamp page ref., -- tlvp
>

Pixed album just went platinum.

-- 
Many thanks,

Don Lancaster                          voice phone: (928)428-4073
Synergetics   3860 West First Street   Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml   email: don@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com

[toc] | [prev] | [next] | [standalone]


#1257

Fromtlvp <mPiOsUcB.EtLlLvEp@att.net>
Date2013-02-10 19:59 -0500
Message-ID<1q0y85gh60vmi$.oztlupw4are9$.dlg@40tude.net>
In reply to#1254
On Sun, 10 Feb 2013 09:47:30 -0700, Don Lancaster wrote:

> Many thanks,

YVW. -- tlvp

[toc] | [prev] | [next] | [standalone]


#1259

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-02-10 21:47 -0800
Message-ID<e0ee0446-9661-4921-83fd-7fcdf65f466b@googlegroups.com>
In reply to#1230
Got BSP generator written and debugged.

It appears to be "working". But it's a Charlie-Brown tree if ever there was one. Using the triangles themselves as partitioning planes appears to be a poor strategy for the teapot. Since it's essentially spherical, the entire shape is only on one "side" of any particular component triangle.

So I need partitioning planes arranged more like an apple-corer: all passing through the line of the y-axis.


/makebsp { % [ triangles ]  .  bsptree
%5 dict
<</P[]/PM[]/plane[]/front[]/behind[]/F<<>>/B<<>>>>
begin

    dup length 1 le{
        dup length 0 eq {
            pop
        }{
            aload pop /P exch def
        }ifelse
    }{ % length>1

    shift /P exch def  % P: Partitioning Polygon (triangle)
    P transpose aload pop
    [1 1 1] 4 array astore % make column vectors of homogeneous coords
    /PM exch def

    [
      PM 0 3 getinterval det
      [ PM 0 get PM 2 get PM 3 get ] det
      [ PM 0 get PM 1 get PM 3 get ] det
      PM 1 3 getinterval det 3 mul
    ] /plane exch def

    /front [] def
    /behind [] def
    { %forall  [P4 P5 P6] = [[x4 y4 z4][x5 y5 z5][x6 y6 z6]]
        /T exch def
        T transpose % [[x4 x5 x6][y4 y5 y6][z4 z5 z6]]
        {aload pop add add} forall % (x4+x5+x6) (y4+y5+y6) (z4+z5+z6)

        plane 2 get mul 3 1 roll % z|C| (x) (y)
        plane 1 get mul 3 1 roll % y|B| z|C| (x)
        plane 0 get mul          % y|B| z|C| x|A|
        plane 3 get add add add  % Ax+By+Cz+D

        0 gt { /front front
        }{ /behind behind
        } ifelse
        T unshift def
    } forall

    front == ()= behind ==
    flush (%lineedit)(r)file pop

    /F front makebsp def
    /B behind makebsp def

    } ifelse
currentdict end
} def

[toc] | [prev] | [next] | [standalone]


#1261

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-02-11 01:16 -0800
Message-ID<7fadcae0-0481-4703-acdc-3619c366b733@googlegroups.com>
In reply to#1259
On Sunday, February 10, 2013 11:47:51 PM UTC-6, luser- -droog wrote:
> Got BSP generator written and debugged.
> 
> It appears to be "working". But it's a Charlie-Brown tree if ever there was one. Using the triangles themselves as partitioning planes appears to be a poor strategy for the teapot. Since it's essentially spherical, the entire shape is only on one "side" of any particular component triangle.
> 

I've posted this as a new question on SO.
http://stackoverflow.com/q/14807341/733077
So if anybody has an idea how to go about slicing up a teapot to use the Painter's Algorithm, please post there. I will vote you up!

-- 
step 1 collect underpants
-------------------------
step 3 profit!

[toc] | [prev] | [next] | [standalone]


#1264

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-02-17 17:16 -0800
Message-ID<8b470c58-9a04-41c2-9b83-613bac429028@googlegroups.com>
In reply to#1261
On Monday, February 11, 2013 3:16:24 AM UTC-6, luser- -droog wrote:
> On Sunday, February 10, 2013 11:47:51 PM UTC-6, luser- -droog wrote:
> 
> > Got BSP generator written and debugged.
> > It appears to be "working". But it's a Charlie-Brown tree if ever there was one. Using the triangles themselves as partitioning planes appears to be a poor strategy for the teapot. Since it's essentially spherical, the entire shape is only on one "side" of any particular component triangle.
> 
> I've posted this as a new question on SO.
> http://stackoverflow.com/q/14807341/733077
> 
> So if anybody has an idea how to go about slicing up a teapot to use the Painter's Algorithm, please post there. I will vote you up!
> 

I just realize my stupid Model->World rotation has been getting in the way. The planes I've been using to slice the teapot are being interpreted as though they applied to the World, but the BSP is built assuming they apply to the Model!

I need to rewrite this whole thing with Z pointing UP the way the data is defined. That should remove this whole issue. 

After that, it should be possible to build an effective BSP with just 3 carefully placed planes, I think. One down the spine, one at the join with the spout, one at the join with the handle.

[toc] | [prev] | [next] | [standalone]


#1265

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-02-17 17:20 -0800
Message-ID<1f2a9845-041e-4914-8142-7ad6d346624c@googlegroups.com>
In reply to#1264
On Sunday, February 17, 2013 7:16:35 PM UTC-6, luser- -droog wrote:
> On Monday, February 11, 2013 3:16:24 AM UTC-6, luser- -droog wrote:
> 
> > On Sunday, February 10, 2013 11:47:51 PM UTC-6, luser- -droog wrote:
> 
> > 
> 
> > > Got BSP generator written and debugged.
> 
> > > It appears to be "working". But it's a Charlie-Brown tree if ever there was one. Using the triangles themselves as partitioning planes appears to be a poor strategy for the teapot. Since it's essentially spherical, the entire shape is only on one "side" of any particular component triangle.
> 
> > 
> 
> > I've posted this as a new question on SO.
> 
> > http://stackoverflow.com/q/14807341/733077
> 
> > 
> 
> > So if anybody has an idea how to go about slicing up a teapot to use the Painter's Algorithm, please post there. I will vote you up!
> 
> > 
> 
> 
> 
> I just realize my stupid Model->World rotation has been getting in the way. The planes I've been using to slice the teapot are being interpreted as though they applied to the World, but the BSP is built assuming they apply to the Model!
> 
> 
> 
> I need to rewrite this whole thing with Z pointing UP the way the data is defined. That should remove this whole issue. 
> 
> 
> 
> After that, it should be possible to build an effective BSP with just 3 carefully placed planes, I think. One down the spine, one at the join with the spout, one at the join with the handle.

Also, I think I can get a significant speed gain by building the BSP out of patches, and then traversing and subdividing the lists.

Oh yeah, and *lists* to do that to! My current code keeps doing partitions down to the leaves. With one triangle in each node. A depth-limit (tied to the number of partition planes defined) should gain some speed there too.

[toc] | [prev] | [next] | [standalone]


#1268

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-02-22 16:50 -0800
Message-ID<56e42694-0e70-4539-8c21-5ce52df4b3d6@googlegroups.com>
In reply to#1265
On Sunday, February 17, 2013 7:20:29 PM UTC-6, luser- -droog wrote:
> On Sunday, February 17, 2013 7:16:35 PM UTC-6, luser- -droog wrote:
> > On Monday, February 11, 2013 3:16:24 AM UTC-6, luser- -droog wrote:
> > > On Sunday, February 10, 2013 11:47:51 PM UTC-6, luser- -droog wrote:
> > > > Got BSP generator written and debugged.
> > > > It appears to be "working". But it's a Charlie-Brown tree if ever there was one. Using the triangles themselves as partitioning planes appears to be a poor strategy for the teapot. Since it's essentially spherical, the entire shape is only on one "side" of any particular component triangle.
> > > I've posted this as a new question on SO.
> > > http://stackoverflow.com/q/14807341/733077
> > > So if anybody has an idea how to go about slicing up a teapot to use the Painter's Algorithm, please post there. I will vote you up!
> > I just realize my stupid Model->World rotation has been getting in the way. The planes I've been using to slice the teapot are being interpreted as though they applied to the World, but the BSP is built assuming they apply to the Model!
> > I need to rewrite this whole thing with Z pointing UP the way the data is defined. That should remove this whole issue. 
> > After that, it should be possible to build an effective BSP with just 3 carefully placed planes, I think. One down the spine, one at the join with the spout, one at the join with the handle.
> Also, I think I can get a significant speed gain by building the BSP out of patches, and then traversing and subdividing the lists.
> Oh yeah, and *lists* to do that to! My current code keeps doing partitions down to the leaves. With one triangle in each node. A depth-limit (tied to the number of partition planes defined) should gain some speed there too.

New version, implementing all the above is at
http://code.google.com/p/xpost/downloads/detail?name=tea2.ps

It doesn't do the "three planes", but instead simulates an octree with an explicit list of planes for the binary partitioning.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web