POV-Ray : Newsgroups : povray.newusers : Wire View Server Time
1 Nov 2024 14:16:33 EDT (-0400)
  Wire View (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Gyscos
Subject: Wire View
Date: 28 Jun 2008 13:55:00
Message: <web.4866772ea21a28c21ba56a630@news.povray.org>
Hello !
I'm trying to make a wire view of some of my objects.
I know it isn't possible with POV-Ray basics options, but I'm trying to do it
through a macro...
Yet, I can't get it done...
I'm currently doing intersection with ( an union of (intersection of planes) )
but it gives me more than just the wires...
Here is a picture (wireview of the basic scene sphere) :
http://gyscos.fr/images/wireview.png


Post a reply to this message

From: Gyscos
Subject: Re: Wire View
Date: 28 Jun 2008 14:05:00
Message: <web.48667c9717d8f3841ba56a630@news.povray.org>
"Gyscos" <gys### [at] gmailcom> wrote:
> Hello !
> I'm trying to make a wire view of some of my objects.
> I know it isn't possible with POV-Ray basics options, but I'm trying to do it
> through a macro...
> Yet, I can't get it done...
> I'm currently doing intersection with ( an union of (intersection of planes) )
> but it gives me more than just the wires...
> Here is a picture (wireview of the basic scene sphere) :
> http://gyscos.fr/images/wireview.png

<_< Ok, just notices the tutorial :
http://news.povray.org/povray.binaries.tutorials/thread/%3Cweb.470f083961a4a39a5a73e3b40@news.povray.org%3E/
I was trying to do a real wire object, but it seems uv-mapping and textures are
a better option >_<


Post a reply to this message

From: Gyscos
Subject: Re: Wire View
Date: 28 Jun 2008 14:25:00
Message: <web.486681f417d8f3841ba56a630@news.povray.org>
Well I was'nt fully satisfied with the tutorial, since the wire were too thin
(they are flat actually since it is just on the texture) so I made another
macro, who removes the original object scaled 0.995.

Here is my macro (it uses a slave to avoid code repetition) :

#macro wireview_slave(max_value, space, toward, epsilon)
  #local temp_value = 0;
  #while (temp_value <= max_value)
    intersection {
      plane {
        toward,
        temp_value+epsilon
      }
      plane {
        -toward,
        -temp_value+epsilon
      }
    }
    intersection {
      plane {
        toward,
        -temp_value+epsilon
      }
      plane {
        -toward,
        temp_value+epsilon
      }
    }

    #local temp_value = temp_value + space;
  #end
#end

#macro wireview(cible, max_x, max_y, max_z, space, epsilon)
  intersection {
    difference {
      object {
        cible
      }
      object {
        cible
        scale 0.995
      }
    }
    union {
      wireview_slave(max_x,space,x, epsilon)
      wireview_slave(max_y,space,y, epsilon)
      wireview_slave(max_z,space,z, epsilon)

    }
  }
#end

http://gyscos.fr/images/test2.png

Problem occurs when I try it with non centered objects...


Post a reply to this message

From: SharkD
Subject: Re: Wire View
Date: 28 Jun 2008 14:50:00
Message: <web.4866870617d8f384fa138a830@news.povray.org>
Hmmm... It would be interesting if the sphere were made of a single piece of
wire.

-Mike


Post a reply to this message

From: Tim Attwood
Subject: Re: Wire View
Date: 29 Jun 2008 05:46:29
Message: <486759f5@news.povray.org>
> Well I was'nt fully satisfied with the tutorial, since the wire were too 
> thin
> (they are flat actually since it is just on the texture) so I made another
> macro, who removes the original object scaled 0.995.

You could use the trace function to place spheres and cylinders.


Post a reply to this message

From: Gyscos
Subject: Re: Wire View
Date: 30 Jun 2008 03:15:01
Message: <web.4868879717d8f3841ba56a630@news.povray.org>
It might work with convex objects. But if there is a hole inside the object, I
may never find it with trace.
Besides, from where would I "send" the trace vectors ? It would need to be from
outside the object, but I don't know the size of the object... (ok, we could add
a size parameter to the macro...)


Post a reply to this message

From: Mike Williams
Subject: Re: Wire View
Date: 30 Jun 2008 04:03:10
Message: <O6V4c5C6DJaIFw4a@econym.demon.co.uk>
Wasn't it Gyscos who wrote:
>It might work with convex objects. But if there is a hole inside the object, I
>may never find it with trace.
>Besides, from where would I "send" the trace vectors ? It would need to be from
>outside the object, but I don't know the size of the object... (ok, we 
>could add
>a size parameter to the macro...)

You could fire the trace rays outwards from the centre of the object 
instead of inwards from outside the object. You get worse problems with 
holes because in some circumstances you'd find the hole instead of the 
outer surface. You need to know the location of the centre, but you'd 
need that anyway when tracing inwards.

You might think that you could fix the problem with non-convex objects 
by always firing a continuation ray. When trace finds something, always 
assume that you've hit a hole, and perform another trace from that point 
using the same direction. Repeat the process until trace doesn't find 
anything. This will find all parts of the surface, but in some 
circumstances it's going to be rather difficult to work out how to add 
wires to connect the various patches of surface that are found. 
[Consider the situation of tracing a torus.]

The continuation ray idea works slightly better when tracing outwards, 
because if you trace inwards your continuation rays go right through the 
centre and find the other side of the object.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Chris B
Subject: Re: Wire View
Date: 30 Jun 2008 05:28:24
Message: <4868a738$1@news.povray.org>
"Gyscos" <gys### [at] gmailcom> wrote in message 
news:web.486681f417d8f3841ba56a630@news.povray.org...
> Well I was'nt fully satisfied with the tutorial, since the wire were too 
> thin

You may be interested to take a look at a couple of the submissions on the 
Object Collection at http://lib.povray.org/searchcollection/index.php - 
Search for 'Grid' and select 'Partial word search '.

The GridLines texture uses an approach similar to the texture tutorial you 
mentioned.
The ShapeGrid macros give you objects similar to the one you've defined, but 
for a range of different shapes. You can use these objects as you have done 
in a CSG operation, or you can use them as textures by using the object 
pattern. Both techniques are illustrated.

The trace function has already been discussed. I just wanted to add that you 
can often circumvent the problem of concave indentations by moving the point 
from which the trace starts as the scan progresses. Effectively creating a 
scan path through the object. Clearly this requires some prior knowledge of 
the shape, but it can then cope with far more complex scans.

Regards,
Chris B.


Post a reply to this message

From: Gyscos
Subject: Re: Wire View
Date: 30 Jun 2008 08:05:00
Message: <web.4868cb1917d8f3841ba56a630@news.povray.org>
ShapeGrid and GrideLines seem interesting, I'll have a look at it...
But this will not work with totally random shapes, such as blob trees from
TOMTREE or meshes imported from Blender or any other software...

I guess the real universal way is the grid texture... Bah, it's not that bad ^^


Post a reply to this message

From: Chris B
Subject: Re: Wire View
Date: 30 Jun 2008 08:24:33
Message: <4868d081@news.povray.org>
"Gyscos" <gys### [at] gmailcom> wrote in message 
news:web.4868cb1917d8f3841ba56a630@news.povray.org...
> ShapeGrid and GrideLines seem interesting, I'll have a look at it...
> But this will not work with totally random shapes, such as blob trees from
> TOMTREE or meshes imported from Blender or any other software...

There would be a problem if you need the lattice to cover only the surface 
layer because using a scaled down copy to do a 'difference' wouldn't 
deliver.

Another alternative, depending on your precise needs would be build a 
lattice work of crossing cylinders and use 'intersection' to give you a sort 
of framework structure, a bit like the frame inside the statue of liberty 
and electricity pylons, except that you'd have little jutting out bits where 
some cut cylinders are only joined at one end. You could do a fine-lined 
generic one or you could exercise a degree of artistic control. For example, 
with a tree you could build a matrix of thicker cylinders in the centre at 
the base and thinner cylinders as it rises up and spreads out away from the 
core.

> I guess the real universal way is the grid texture... Bah, it's not that 
> bad ^^

I think so, this would give you a wider range of patterns to choose from.

Regards,
Chris B.


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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