POV-Ray : Newsgroups : povray.newusers : Problem with union of several touching polygons resulting in closed surface : Re: Problem with union of several touching polygons resulting in closed sur= Server Time
2 Jun 2024 10:48:26 EDT (-0400)
  Re: Problem with union of several touching polygons resulting in closed sur=  
From: waggy
Date: 23 Mar 2013 19:00:01
Message: <web.514e32be3382d33621be1230@news.povray.org>
I don't think POV-Ray can make a solid object with an interior form polygons.

Looking at the linked image, I see a convex hull with flat sides that is an
intersection of an octahedron with a cube. Taking Gamma as the origin, the point
labeled X appears to be on one surface of the cube, with its normal pointing
along the vector from Gamma to X. Similarly, L appears to be on a surface of the
octahedron with its normal pointing from Gamma to L.

I like to make flat-sided convex hulls by intersecting planes.

#version 3.7;

#declare coc=1;// Guessed

#declare xdach=<0,0,-1>;
#declare zdach=<0,1,0>;
#declare ydach=<1,0,0>;
#declare k1=(-xdach+ydach+(1/coc)*zdach);
#declare k2=(xdach-ydach+(1/coc)*zdach);
#declare k3=(xdach+ydach-(1/coc)*zdach);
#declare L = 0.5*(k1+k2+k3) ;
#declare X = 0.5*(k2+k3);
#declare Xp = 0.5*(k1+k2);

#local X_pt = Xp;//<0,2,0>;
#local L_pt = L ;//<1,1,1>;

sphere{X_pt,0.05 pigment{color rgb<1,0,0>}}
sphere{L_pt,0.05 pigment{color rgb<0,1,0>}}

intersection{
   // Octahedron
   plane{L_pt,vlength(L_pt)             }
   plane{L_pt,vlength(L_pt) rotate  90*z}
   plane{L_pt,vlength(L_pt) rotate 180*z}
   plane{L_pt,vlength(L_pt) rotate 270*z}
   plane{L_pt,vlength(L_pt)              scale<1,1,-1>}
   plane{L_pt,vlength(L_pt) rotate  90*z scale<1,1,-1>}
   plane{L_pt,vlength(L_pt) rotate 180*z scale<1,1,-1>}
   plane{L_pt,vlength(L_pt) rotate 270*z scale<1,1,-1>}

   // Cube
   plane{X_pt,vlength(X_pt) }
   plane{X_pt,vlength(X_pt) rotate  90*z}
   plane{X_pt,vlength(X_pt) rotate 180*z}
   plane{X_pt,vlength(X_pt) rotate 270*z}
   plane{X_pt,vlength(X_pt) rotate  90*x}
   plane{X_pt,vlength(X_pt) rotate -90*x}

   pigment{color rgb<1,1,1>}
}
light_source{<1,1,1>*10, rgb<1,1,1>}
camera{location <4,2,2> look_at<0,0,0>}
// By default, x points to the right, y points upwards, and depth is along z.


Post a reply to this message

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