POV-Ray : Newsgroups : povray.general : REQUEST: Macro fol Scaffold? Server Time
24 Nov 2024 09:11:26 EST (-0500)
  REQUEST: Macro fol Scaffold? (Message 1 to 10 of 19)  
Goto Latest 10 Messages Next 9 Messages >>>
From: Sven Littkowski
Subject: REQUEST: Macro fol Scaffold?
Date: 28 Jul 2019 23:48:47
Message: <5d3e6c9f$1@news.povray.org>
Hi,

I have a cylinder shape in my scene, but want to build a scaffold around 
it of triangles. Is there any macro or formula that can do that, with me 
specifying thickness of the scaffold poles and the size of the triangles?

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Bald Eagle
Subject: Re: REQUEST: Macro fol Scaffold?
Date: 29 Jul 2019 06:20:01
Message: <web.5d3ec7e24ed4290e4eec112d0@news.povray.org>
Sven Littkowski <wrt### [at] yahoocom> wrote:
> Hi,
>
> I have a cylinder shape in my scene, but want to build a scaffold around
> it of triangles. Is there any macro or formula that can do that, with me
> specifying thickness of the scaffold poles and the size of the triangles?
>
> ---
> Diese E-Mail wurde von AVG auf Viren geprüft.
> http://www.avg.com

Easiest way would be to go around in a circle using r sin z and r cos x and make
a regular polygon.  Step up the side of the cylinder and zig-zag up from your
old polygon to where the new one will be.  Using an even number of sides will
make finding the radius and doing the zig-zags easier I think.

Once you get that worked out, you can likely back-calculate to how large the
triangles are and see if changing that will overcomplicate things.


Post a reply to this message

From: Thomas de Groot
Subject: Re: REQUEST: Macro fol Scaffold?
Date: 29 Jul 2019 07:01:49
Message: <5d3ed21d@news.povray.org>
Op 29/07/2019 om 12:18 schreef Bald Eagle:
> 
> Sven Littkowski <wrt### [at] yahoocom> wrote:
>> Hi,
>>
>> I have a cylinder shape in my scene, but want to build a scaffold around
>> it of triangles. Is there any macro or formula that can do that, with me
>> specifying thickness of the scaffold poles and the size of the triangles?
>>
>> ---
>> Diese E-Mail wurde von AVG auf Viren geprüft.
>> http://www.avg.com
> 
> Easiest way would be to go around in a circle using r sin z and r cos x and make
> a regular polygon.  Step up the side of the cylinder and zig-zag up from your
> old polygon to where the new one will be.  Using an even number of sides will
> make finding the radius and doing the zig-zags easier I think.
> 
> Once you get that worked out, you can likely back-calculate to how large the
> triangles are and see if changing that will overcomplicate things.
> 
> 

Years ago, when I was a temporary resident of Gancaloon, I wrote series 
of macros to generate meshes fro a given heigh_field surface. I include 
the set here for your inspiration; no documentation is available 
however. ;-)

-- 
Thomas


Post a reply to this message


Attachments:
Download 'gridgen.mcr.txt' (9 KB)

From: Sven Littkowski
Subject: Re: REQUEST: Macro fol Scaffold?
Date: 29 Jul 2019 11:09:40
Message: <5d3f0c34$1@news.povray.org>
On 29.07.2019 06:01, Thomas de Groot wrote:
> Years ago, when I was a temporary resident of Gancaloon, I wrote series 
> of macros to generate meshes fro a given heigh_field surface. I include 
> the set here for your inspiration; no documentation is available 
> however. ;-)
> 

Thanks. I looked through it, but your code uses too many features I 
never used before. I admit, I lack understanding, wouldn't know where to 
start to make changes, and how to make changes. I might just have to 
give up. :-)


---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Bald Eagle
Subject: Re: REQUEST: Macro fol Scaffold?
Date: 29 Jul 2019 16:25:01
Message: <web.5d3f54f34ed4290e4eec112d0@news.povray.org>
This is from November 2016, where there was some experimentation with scanning
objects with trace() and building triangles.  Obviously still needs some work.
;)

Also, Jerome Grimbert has some excellent additions that do exactly this in
HgPOV-Ray.

http://wiki.povray.org/content/User:Le_Forgeron/tesselation

===========================================================================

#version 3.7;
global_settings {
 assumed_gamma 1.0
 ambient_light color rgb <1, 1, 1>
}
#include "colors.inc"
#include "math.inc"
#include "transforms.inc"

#declare Camera_Origin = camera {
                            location  <0, 0, 0>
                            right    x*image_width/image_height
                            look_at   <0, 0, 0.01>}

#declare Camera_Angle = camera {
                            location  <0.0 , 0.0, 0.0>
                            right    x*image_width/image_height
                            look_at   <100, 30, 0>}
#declare Camera_Front = camera {
                            location  <2, 5, -30.0>
      //location  <0.0, 12, -10.0>
                            right    x*image_width/image_height
      sky y
                            look_at   <2, 5, 0>}
#declare Camera_Rear = camera {
                            location  <0.0, -100.0, -300.0>
                            right    x*image_width/image_height
                            look_at   <0, 0, 0>}
#declare Camera_Top = camera {
                            location  <0, 25.0, 0>
                            right    x*image_width/image_height
                            look_at   <0, 0, 0>}

#declare Camera_Iso = camera {
                            location  <-50, 0, 0>
                            right    x*image_width/image_height
                            look_at   <0, 0, 0>}

//####################
//camera {Camera_Front}
//####################


light_source{ <50, 50, -100>  color rgb <1, 1, 1>}    // White top

// Create an infinite sphere around scene and allow any pigment on it
sky_sphere{ pigment { gradient <0,1,0>
                      color_map { [0.00 rgb <0.6, 0.7, 1.0>]
                                  [0.35 rgb <0.0, 0.1, 0.8>]
                                  [0.65 rgb <0.0, 0.1, 0.8>]
                                  [1.00 rgb <0.6, 0.7, 1.0>]
                                }
                      scale 2
                    } // end of pigment
          } //end of skysphere -------------------------------------


#declare Cylinder = cylinder {<0, 0, 0>, <0, 10, 0> 2 pigment {Red} }
#declare Sphere = sphere {<0, 0, 0>, 2 pigment {Red} }
#declare Box = box {-1, 1 pigment {Red} }
#declare Cross = union {
 cylinder {<0, 0, 0>, <0, 10, 0> 1 pigment {Red} }
 cylinder {<-5, 5, 0>, <5, 5, 0> 1 pigment {Red} }
}
#declare Cross2 = union {
 cylinder {<0, 0, 0>, <0, 10, 0> 1 pigment {Red} }
 cylinder {<-5, 5, 0>, <5, 5, 0> 1 pigment {Red} }
 cylinder {<0, 5, -5>, <0, 5, 5> 1 pigment {Red} }
}
#declare Torus = torus {3, 0.5 pigment {Red} rotate x*0}

#declare Blob =
 //union {
  blob {
  threshold .65
  sphere { <.5,0,0>, .8, 1 pigment {Blue} }
  sphere { <-.5,0,0>,.8, 1 pigment {Red} }
  finish { phong 1 }
  }

//sphere { <.5,0,0>, .8 pigment { Blue transmit .9 }}
//sphere { <-.5,0,0>, .8 pigment { Red transmit .9 }}
//cylinder {<-1, 0, 0>, <1, 0, 0>, 0.65/2  pigment {color White transmit 0.9}
no_shadow}
//}

#declare Object = object {Cylinder}

object {Cylinder}

// Scan object with a loop of traces

#declare Min = min_extent (Object);
#declare Max = max_extent (Object);

#declare MidHeight = (Min.y + Max.y)/2;

#declare Move = (Max.x*2)+4;
#declare Center = (Min.x + Move)/2;

camera {
        location  <Center, MidHeight, (Min.z*10)>
  //location  <0.0, 12, -10.0>
        right    x*image_width/image_height
  sky y
        look_at   <Center, MidHeight, 0>}

#declare TraceRadius = max (Min.x, Max.x, Min.z, Max.z) * 2;
#declare Step = 0.5;
#declare Arcs = 36;
#declare TraceNormal = <0, 0, 0>;

#declare Degrees = 360/Arcs;
#declare OddShift = Degrees/2;
#declare Levels = (Max.y-Min.y)/Step;
#debug concat( " Levels = ", str(Levels, 3, 1), "\n")

#declare TraceMeshArray = array [Levels+1][Arcs+1];
#declare ArrayY = 0;
#declare ArrayX = 0;


#for (Y, Min.y, Max.y, Step)
 #if (odd(ArrayY))
  #declare Shift = OddShift;
 #else
  #declare Shift = 0;
 #end

 #for (Theta, 0, 360, Degrees)
  #declare MyTransform = transform { rotate  y*(Theta+Shift) };
  #declare TracePoint = vtransform (<TraceRadius, Y, 0>, MyTransform);
  #declare TraceMeshArray[ArrayY][ArrayX] = trace(Object, <0, Y, 0>, TracePoint,
TraceNormal);
  //#debug concat( " Y = ", str(ArrayY, 3, 1),  "     X = ", str(ArrayX, 3, 1),
"     TraceNormal = ", vstr(3, TraceNormal, ", ", 3, 0), "\n")
  cylinder {TracePoint, <0, Y, 0> 0.005 pigment {Blue} }
  #declare TraceNormal = <0, 0, 0>;
  #declare ArrayX = ArrayX+1;
 #end
#declare ArrayX = 0;  // reset X
#declare ArrayY = ArrayY+1;
#end



// plot mesh vertices
#declare ArrayY = 0;
#declare ArrayX = 0;
#declare SphereRadius = 0.03;
#for (Y, Min.y, Max.y, Step)
 #for (Theta, 0, 360, Degrees)
  sphere {TraceMeshArray[ArrayY][ArrayX], SphereRadius pigment {Black} translate
x*Move}
  #declare ArrayX = ArrayX+1;
 #end
#declare ArrayX = 0;  // reset X
#declare ArrayY = ArrayY+1;
#end

// draw mesh edges
#declare SphereRadius = 0.025;
#declare ArrayY = 0;
#declare ArrayX = 0;
#declare SphereRadius = 0.0125;
#for (Y, Min.y, Max.y, Step)
 #for (Theta, 0, 360, Degrees)
  //horizontal edges
  #if (ArrayX >= 1)
   //#debug concat( "TraceMeshArray[ArrayY][ArrayX] = ", vstr(3,
TraceMeshArray[ArrayY][ArrayX], ", ", 3, 3), "
TraceMeshArray[ArrayY][ArrayX-1] = ", vstr(3, TraceMeshArray[ArrayY][ArrayX-1],
", ", 3, 3),"\n")
   cylinder {TraceMeshArray[ArrayY][ArrayX],
TraceMeshArray[ArrayY][ArrayX-1]+0.001, SphereRadius pigment {Green} translate
x*Move}
  #end

  // diagonal edges
  #if (Y > Min.y)
   cylinder {TraceMeshArray[ArrayY][ArrayX],
TraceMeshArray[ArrayY-1][ArrayX]+0.001, SphereRadius pigment {Green} translate
x*Move}
   #if (odd(ArrayY))
    #if (ArrayX < Arcs)
     cylinder {TraceMeshArray[ArrayY][ArrayX],
TraceMeshArray[ArrayY-1][ArrayX+1]+0.001, SphereRadius pigment {Green} translate
x*Move}
    #else
     cylinder {TraceMeshArray[ArrayY][ArrayX],
TraceMeshArray[ArrayY-1][0]+0.001, SphereRadius pigment {Green} translate
x*Move}
    #end
   #else
    #if (ArrayX > 0)
     cylinder {TraceMeshArray[ArrayY][ArrayX],
TraceMeshArray[ArrayY-1][ArrayX-1]+0.001, SphereRadius pigment {Green} translate
x*Move}
    #else
     cylinder {TraceMeshArray[ArrayY][ArrayX],
TraceMeshArray[ArrayY-1][0]+0.001, SphereRadius pigment {Green} translate
x*Move}
    #end
   #end
  #end

  #declare ArrayX = ArrayX+1;
 #end
#declare ArrayX = 0;  // reset X
#declare ArrayY = ArrayY+1;
#end


Post a reply to this message

From: Sven Littkowski
Subject: Re: REQUEST: Macro fol Scaffold?
Date: 29 Jul 2019 20:09:59
Message: <5d3f8ad7$1@news.povray.org>
Okay, the scene works now. Thanks!    :-)

---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Sven Littkowski
Subject: Re: REQUEST: Macro fol Scaffold?
Date: 29 Jul 2019 20:10:45
Message: <5d3f8b05$1@news.povray.org>
Thanks. At the moment, there seem to be various errors in the code. Some 
errors were caused by wrong line breaks which I was able to correct 
(Internet line format and Pov-Ray line format). But some other errors I 
cannot dissolve at the moment.


---
Diese E-Mail wurde von AVG auf Viren geprüft.
http://www.avg.com


Post a reply to this message

From: Mike Horvath
Subject: Re: REQUEST: Macro fol Scaffold?
Date: 30 Jul 2019 12:32:41
Message: <5d407129@news.povray.org>
On 7/28/2019 11:48 PM, Sven Littkowski wrote:
> Hi,
> 
> I have a cylinder shape in my scene, but want to build a scaffold around 
> it of triangles. Is there any macro or formula that can do that, with me 
> specifying thickness of the scaffold poles and the size of the triangles?
> 
> ---
> Diese E-Mail wurde von AVG auf Viren geprüft.
> http://www.avg.com
> 

For cylinders, there was Truss Generator include by Theran Cochran. 
Cannot find a download link anywhere however.


Post a reply to this message

From: Bald Eagle
Subject: Re: REQUEST: Macro fol Scaffold?
Date: 30 Jul 2019 13:25:02
Message: <web.5d407d584ed4290e4eec112d0@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:

> For cylinders, there was Truss Generator include by Theran Cochran.
> Cannot find a download link anywhere however.

http://www.oocities.org/ccolefax/links.html


http://www.oocities.org/ccolefax/download/truss.zip


Post a reply to this message

From: Thomas de Groot
Subject: Re: REQUEST: Macro fol Scaffold?
Date: 31 Jul 2019 02:24:41
Message: <5d413429$1@news.povray.org>
Op 30/07/2019 om 19:24 schreef Bald Eagle:
> 
> Mike Horvath <mik### [at] gmailcom> wrote:
> 
>> For cylinders, there was Truss Generator include by Theran Cochran.
>> Cannot find a download link anywhere however.
> 
> http://www.oocities.org/ccolefax/links.html
> 
> 
> http://www.oocities.org/ccolefax/download/truss.zip
> 
> 

Careful! Malwarebytes blocked both sites here.

-- 
Thomas


Post a reply to this message

Goto Latest 10 Messages Next 9 Messages >>>

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