Thread View: povray.advanced-users
1 messages
1 total messages
Started by architype
Tue, 09 Aug 2016 04:42
Re: Mesh replacements for primitives?
Author: architype
Date: Tue, 09 Aug 2016 04:42
Date: Tue, 09 Aug 2016 04:42
207 lines
4875 bytes
4875 bytes
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>
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads