POV-Ray : Newsgroups : povray.advanced-users : Mesh replacements for primitives? : Re: Mesh replacements for primitives? Server Time
1 May 2024 19:34:52 EDT (-0400)
  Re: Mesh replacements for primitives?  
From: architype
Date: 9 Aug 2016 00:45:00
Message: <web.57a95f3fdb2c47319403bba30@news.povray.org>
Glad you liked the code. :)
I keep them in my insert menu and often use them in my projects.
I did a demo of the rotated box, the vault below. It works, but
parse time is prohibitive, almost 15 seconds. (My old computer is
not that bad...) I didnt realize my code was that crappy... :/
The mesh is only 12x4x9x12 = 5184 triangles, it shouldnt take 15
seconds to create... But I suppose one could create just a single
arch in this case. But it is most annoying....

I rarely use the complex surfaces, so I cant help you there.

Yep, it is very useful for making architecture and generally objects
that you use more than once.

Best wishes! /A

//-----------------------------------------
// Var

#local VaultR = 5;

#local CofferNum = 12;

#local CofferW = 1.33;
#local CofferH = .5;

#local EdgeDE = CofferW/4;




// LOAD ONCE
#include "MeshPntTrn.Inc"

#local CofferVaultObj=
mesh{

#local CountJ = 3;
#local J = 0;
#while ( J <= CountJ )

 #local CountI = CofferNum-1;
 #local I = 0;
 #while ( I <= CountI )


// Back
#local bW = CofferW;
#local bH = CofferH;
#local bT = CofferW;

#local Init_Trn = <0, VaultR, 0>;

#local aX = 180/CofferNum*I;
#local aY = 0;
#local aZ = 0;

#local Place_Trn = <J*CofferW, 0, 0>;

#include "ROT_TRN.tch"


// Edges part 1

#local bW = EdgeDE;
#local bH = CofferH;
#local bT = CofferW;

#local Init_Trn = <CofferW/2-EdgeDE/2, VaultR-EdgeDE/2, 0>;

#local aX = 180/CofferNum*I;
#local aY = 0;
#local aZ = 0;

#local Place_Trn = <J*CofferW, 0, 0>;

#include "ROT_TRN.tch"


#local bW = EdgeDE;
#local bH = CofferH;
#local bT = CofferW;

#local Init_Trn = <-CofferW/2+EdgeDE/2, VaultR-EdgeDE/2, 0>;

#local aX = 180/CofferNum*I;
#local aY = 0;
#local aZ = 0;

#local Place_Trn = <J*CofferW, 0, 0>;

#include "ROT_TRN.tch"


#local bW = CofferW;
#local bH = CofferH;
#local bT = EdgeDE;

#local Init_Trn = <0, VaultR-EdgeDE/2, -CofferW/2+EdgeDE/2>;

#local aX = 180/CofferNum*I;
#local aY = 0;
#local aZ = 0;

#local Place_Trn = <J*CofferW, 0, 0>;

#include "ROT_TRN.tch"

#local bW = CofferW;
#local bH = CofferH;
#local bT = EdgeDE;

#local Init_Trn = <0, VaultR-EdgeDE/2, CofferW/2-EdgeDE/2>;

#local aX = 180/CofferNum*I;
#local aY = 0;
#local aZ = 0;

#local Place_Trn = <J*CofferW, 0, 0>;

#include "ROT_TRN.tch"



// Edges part 2
#local bW = EdgeDE/2;
#local bH = CofferH;
#local bT = CofferW;

#local Init_Trn = <CofferW/2-EdgeDE/4, VaultR-EdgeDE, 0>;

#local aX = 180/CofferNum*I;
#local aY = 0;
#local aZ = 0;

#local Place_Trn = <J*CofferW, 0, 0>;

#include "ROT_TRN.tch"


#local bW = EdgeDE/2;
#local bH = CofferH;
#local bT = CofferW;

#local Init_Trn = <-CofferW/2+EdgeDE/4, VaultR-EdgeDE, 0>;

#local aX = 180/CofferNum*I;
#local aY = 0;
#local aZ = 0;

#local Place_Trn = <J*CofferW, 0, 0>;

#include "ROT_TRN.tch"


#local bW = CofferW;
#local bH = CofferH;
#local bT = EdgeDE/2;

#local Init_Trn = <0, VaultR-EdgeDE, -CofferW/2+EdgeDE/4>;

#local aX = 180/CofferNum*I;
#local aY = 0;
#local aZ = 0;

#local Place_Trn = <J*CofferW, 0, 0>;

#include "ROT_TRN.tch"

#local bW = CofferW;
#local bH = CofferH;
#local bT = EdgeDE/2;

#local Init_Trn = <0, VaultR-EdgeDE, CofferW/2-EdgeDE/4>;

#local aX = 180/CofferNum*I;
#local aY = 0;
#local aZ = 0;

#local Place_Trn = <J*CofferW, 0, 0>;

#include "ROT_TRN.tch"


 #local I = I + 1;
 #end

#local J = J + 1;
#end




translate<CofferW/2,0,0>
rotate x*-180/CofferNum/2

translate<CofferW*-2,0,0>
rotate x*90
rotate y*90

translate<0, 1, 0>

}


Post a reply to this message

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