POV-Ray : Newsgroups : povray.binaries.images : Fat triangles Server Time
19 Apr 2024 04:24:36 EDT (-0400)
  Fat triangles (Message 11 to 20 of 21)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>
From: JimT
Subject: Re: Fat triangles
Date: 31 May 2018 05:55:01
Message: <web.5b0fc632532d7f86be7517870@news.povray.org>
"lelama" <nomail@nomail> wrote:

Sorry, I've just got a new pair of glasses and misread your name. Maybe I should
go back to the optician.


Post a reply to this message

From: JimT
Subject: Re: Fat triangles
Date: 31 May 2018 06:15:01
Message: <web.5b0fcad3532d7f86be7517870@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "JimT" <nomail@nomail> wrote:
>
> looks all very impressive, I really like the office chair.
>
> > I've posted these to see if there is enough interest for me to either post code,
> > bugs and all, or spend (quite a bit of) time cleaning it up and uploading to
> > objects.
>
> I'd love to see the code for the shapes of your first post, hope you can post.
>
I will post code real soon now (RIP Jerry Pournelle), but lelama having pointed
out that the fat triangle is simpler than I thought, I think I should simplify
the code a little before I do.

I like the office chair too.


Post a reply to this message


Attachments:
Download 'fat_bezier_basic_examples.png' (116 KB)

Preview of image 'fat_bezier_basic_examples.png'
fat_bezier_basic_examples.png


 

From: JimT
Subject: Re: Fat triangles
Date: 31 May 2018 06:30:01
Message: <web.5b0fce2d532d7f86be7517870@news.povray.org>
"JimT" <nomail@nomail> wrote:
>
> I like the office chair too.

Wrong image.


Post a reply to this message


Attachments:
Download 'fat_bezier_test_examples.png' (115 KB)

Preview of image 'fat_bezier_test_examples.png'
fat_bezier_test_examples.png


 

From: Stephen
Subject: Re: Fat triangles
Date: 31 May 2018 06:49:04
Message: <5b0fd320$1@news.povray.org>
On 31/05/2018 10:50, JimT wrote:
> Round_Cone, Round_Cone_Union, Round_Cone_Merge and Round_Cone2 and Round_Cone3
> variants are in shapes.inc from John vanSickle.

Thanks, nice "organic" look.

-- 

Regards
     Stephen


Post a reply to this message

From: Bald Eagle
Subject: Re: Fat triangles
Date: 31 May 2018 09:55:00
Message: <web.5b0ffe15532d7f86c437ac910@news.povray.org>
"JimT" <nomail@nomail> wrote:
> Everyone is familiar with the roundcone, a convex object, and the sphere sweep
> derived from it. A while ago I thought about connecting three spheres smoothly
> with cones.

NICE shapes, and beautiful office chair!   :)


I am not at all sure if it's even analogous,  but a while back I ran across an
interesting page that made a rounded cuboid, like a superellipsoid, using IIRC
max and/or min functions.

I successfully reproduced this.

I'm not sure if you can do the same with triangles, but at least intuitively, it
seems possible.

Unfortunately, I'm at work, in the middle of (ok, at the tail end of) moving,
and have to bring my son to the dentist....   so I haven't been able to dig up
the original page.

This is the closest I've found so far:

http://iquilezles.org/www/articles/distfunctions/distfunctions.htm

Maybe if you can do it as an isosurface, and then use one of the
grid/mesh/smooth triangle methods of vastly speeding it up...


Just a weird tangential idea....


Post a reply to this message

From: lelama
Subject: Re: Fat triangles
Date: 31 May 2018 10:15:00
Message: <web.5b10030c532d7f8621263ef70@news.povray.org>
"JimT" <nomail@nomail> wrote:
> "lelama" <nomail@nomail> wrote:
>
> Sorry, I've just got a new pair of glasses and misread your name. Maybe I should
> go back to the optician.

No problem at all ;)

A question about your computations.
I remember that the hard part for me was to compute the formulas for the 6
points of tangency. Found very complicated formulas on the web although there is
a simple one after a moment of thougt. I have forgotten the formula. Have you a
simple method to compute the six points  and/or remember the formula ?

An other thing that I had in mind was the possibility to draw arbitrary convex
hulls with rounded corners. Given a set of points with a radius at each point or
a set of planes with a radius at each vertex, one can draw the convex set with
rounded triangles. Although the code is not immediate, this would allow the
construction of many rounded objects.


Post a reply to this message

From: JimT
Subject: Re: Fat triangles
Date: 31 May 2018 11:45:00
Message: <web.5b101737532d7f86be7517870@news.povray.org>
"lelama" <nomail@nomail> wrote:
> "JimT" <nomail@nomail> wrote:
> > "lelama" <nomail@nomail> wrote:
> >
> > Sorry, I've just got a new pair of glasses and misread your name. Maybe I should
> > go back to the optician.
>
> No problem at all ;)
>
> A question about your computations.
> I remember that the hard part for me was to compute the formulas for the 6
> points of tangency. Found very complicated formulas on the web although there is
> a simple one after a moment of thougt. I have forgotten the formula. Have you a
> simple method to compute the six points  and/or remember the formula ?
>
Not simple.

I looked at it from the standpoint of a pair of round cones, and there are
possibilities that the fat triangle degenerates into a single round cone, so
lots of #if statements.

I'll look at it again to see if I can simplify using the tangent plane to three
spheres idea. Either way, I'll post the code, as I said, real soon now.

> An other thing that I had in mind was the possibility to draw arbitrary convex
> hulls with rounded corners. Given a set of points with a radius at each point or
> a set of planes with a radius at each vertex, one can draw the convex set with
> rounded triangles. Although the code is not immediate, this would allow the
> construction of many rounded objects.
>
This is a good idea.

I have done a tetrahedron.

Passing an array of vertex vectors, an array of radii and an array of vertex
vector indices, like a mesh2, will allow a general rounded "convex hull" (which
actually might not be convex) and would be easy to do. I'll try tonight. I'll
aim for a rounded icosahedron with one face missing.

The hob-nailed boot way would be just a loop over faces, producing a fat
triangle for each face. This would include vertex spheres several times, edge
cones twice and both triangular faces for each fat triangle. This is all I did
for the tetrahedron. Including both triangular faces is probably a good idea to
allow for non-closed meshes, but generating a list of unique edges shouldn't be
too hard.


Post a reply to this message

From: Bald Eagle
Subject: Re: Fat triangles
Date: 31 May 2018 12:20:00
Message: <web.5b1020a3532d7f86c437ac910@news.povray.org>
"lelama" <nomail@nomail> wrote:
> > I've posted these to see if there is enough interest for me to either post code,
> > bugs and all, or spend (quite a bit of) time cleaning it up and uploading to
> > objects.

Yes, there is always interest - I played with the very simplest of objects a
while back - a rounded box with different radii, for a plastic tabletop for my
warehouse WIP.
I see that was your initial impetus as well.

> Thanks Jim, this is an interesting idea.
>
> I made some trials on the same idea although my computations were the other way
> round : from the three spheres, let say in the horizontal plane, I first
> computed the 2 tangent planes to the three spheres, the one above the spheres
> and the one below. From the 6 tangency points, we get 6 lines. Grouping these
> lines by pair, we get 3 cones. More specifically, in the middlee of each pair is
> a line through the centers of 2 spheres, and the corresponding lathe object
> around the middle line is the cone to be added.
>
> This construction shows if I am not wrong that the cone is tangent to the plane,
> so I did not understand your C1-problems in your first message.
>
> My goal was much more simple than what you did. I just wanted to draw rounded
> boxes with different radius along the edges.

My naive take on this is just instantiate 3 spheres, put 3 cones in - that
stretch between centers and have the appropriate radii on either end,  and then
place 2 triangles stretching across the top and bottom center points of the
spheres.
This of course assumes that the spheres are coplanar with - let's say, the x-z
plane.

Not having had the time to code this up and render a few examples, I could be
WAY off.

I think the polyhedra are cases that will probably show that more general cases
are indeed more complex and require some tangency points to be calculated.
I've been meaning to code up some of the more basic "here's where two lines
intersect" type tools - but then some damned thing IRL always becomes higher
priority.  :(


Post a reply to this message

From: JimT
Subject: Re: Fat triangles
Date: 31 May 2018 13:15:01
Message: <web.5b102d0a532d7f86be7517870@news.povray.org>
"lelama" <nomail@nomail> wrote:
> "JimT" <nomail@nomail> wrote:
> > "lelama" <nomail@nomail> wrote:
> >
>
> An other thing that I had in mind was the possibility to draw arbitrary convex
> hulls with rounded corners. Given a set of points with a radius at each point or
> a set of planes with a radius at each vertex, one can draw the convex set with
> rounded triangles. Although the code is not immediate, this would allow the
> construction of many rounded objects.

The hob-nailed boot code was very simple.

Here is a not quite octahedron.


Post a reply to this message


Attachments:
Download 'fat_bezier_round_mesh_examples.png' (29 KB)

Preview of image 'fat_bezier_round_mesh_examples.png'
fat_bezier_round_mesh_examples.png


 

From: lelama
Subject: Re: Fat triangles
Date: 1 Jun 2018 05:30:00
Message: <web.5b111102532d7f8621263ef70@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> My naive take on this is just instantiate 3 spheres, put 3 cones in - that
> stretch between centers and have the appropriate radii on either end,  and then
> place 2 triangles stretching across the top and bottom center points of the
> spheres.
> This of course assumes that the spheres are coplanar with - let's say, the x-z
> plane.
>

Hi Bald Eagle,
Unfortunatly, the vertices of the triangles are not the top and bottom of the
shperes. This is the tricky part. I don't know if Jim had a simpler idea
but here is how I did proceed.

Preparation step in the plane. It is not too difficult find the equation of a
line tangent to two circles located on a horizontal line and above the circles.
Correspondingly, if you have  now two shperes in diementsion 3 with centers on
(0,0,0) and (x,0,0), basically the same computation gives you the equation of a
horizontal plane tangent to 2 spheres. Now you want the plane P2 tangent to
three spheres (above the spheres), not the horizontal plane P1 tangent to two
spheres. Note that  P2 is obtained from P1 by a rotation  around the axis Ox. We
normalize the equations of the planes and put them in the form ax+by+cz=1, ie
the constant is normalized to 1. With this normalization fixed, the roational
difference between P1 and P2 corresponds algebraically to the fact that P1 and
P2 have the same constant a in their equation. Since you know the coeffs of P1,
you have a formula for the a-coeff of P2.

One coefficient has been discovered using a pair of spheres. Since there are
three pairs of spheres that you can use, this finally gives completly the
coefficients of the plane tangent to the three spheres.


> I've been meaning to code up some of the more basic "here's where two lines
> intersect" type tools - but then some damned thing IRL always becomes higher
> priority.  :(

Many of these geometric tools (intersection of
lines,planes,projections,coordinate changes...) have been implemented
in Pycao ( my software to describe povray scenes with the python language). Feel
free to use it or to look at the code if you prefer the povray sdl language.
(This is a gpl license).


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 1 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.