🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: povray.advanced-users
Article #1

Re: Mesh replacements for primitives?

#1
From: architype
Date: Tue, 09 Aug 2016 04:42
207 lines
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>

}


Technical Details
Message-ID: <web.57a95f3fdb2c47319403bba30@news.povray.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!news.povray.org!2.68.97.253
References: <web.57a91764db2c47315e7df57c0@news.povray.org>

Show Full Headers
Complete Article Headers
Message-ID: <web.57a95f3fdb2c47319403bba30@news.povray.org>
Subject: Re: Mesh replacements for primitives?
Date: Tue, 9 Aug 2016 00:42:39 EDT
From: "architype" <architype@gmx.com>
References: <web.57a91764db2c47315e7df57c0@news.povray.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!news.povray.org!2.68.97.253
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
Newsgroups: povray.advanced-users
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Source: +OsE/ycG/fz9HhP06/Mi/gbmHA40Lyrs6yomDgr9DwjrCC0P3Xh5woCijKDdlZikm6dry9ugfK2BwGrL3aptwsfMoZ/dv37Z
X-Newsreader: POV-Ray Web Interface
X-User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
NNTP-Posting-Host: 203.29.75.35
X-Trace: news.povray.org 1470717900 203.29.75.35 (9 Aug 2016 00:45:00 -0400)
Lines: 206
X-No-Archive: Yes
X-Copyright: This copyrighted article comes from a private news server and may NOT be distributed on USENET or other news servers.
X-POV-Header: --- --- --- --- --- --- --- --- --- --- --- ---