Added sphere resolution and max recursion parameters

This commit is contained in:
Gregorio Palmas palmas 2010-01-26 17:40:04 +00:00
parent 8cac33f567
commit 55a6475e6c
9 changed files with 293 additions and 86 deletions

View File

@ -21,18 +21,8 @@ using namespace SyntopiaCore::Exceptions;
FilterSSynth::FilterSSynth(){
typeList<< CR_SSYNTH;
FilterIDType tt;
this->renderTemplate= QString("%1 %2 %3 %4 %5 %6 %7 %8 %9 %10")
.arg("<template defaultExtension=\"X3D file format (*.x3d)\" name=\"x3d\" ><description>Custom x3d export template</description><primitive name=\"begin\"><![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
.arg("<!DOCTYPE X3D PUBLIC \"ISO//Web3D//DTD X3D 3.1//EN\" \"http://www.web3d.org/specifications/x3d-3.1.dtd\"><X3D profile=\"Immersive\" version=\"3.1\" xsd:noNamespaceSchemaLocation=\"http://www.web3d.org/specifications/x3d-3.1.xsd\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema-instance\" ><head></head><Scene>]]></primitive>")
.arg("<primitive name=\"end\"><![CDATA[</Scene></X3D>]]></primitive>")
.arg("<primitive name=\"sphere\"><![CDATA[<Transform translation=\"{cx} {cy} {cz}\" scale=\"{x3dsphscale}\"><Shape><IndexedFaceSet solid=\"true\" coordIndex=\"14 12 1 -1, 12 14 13 -1, 2 13 14 -1, 13 0 12 -1, 16 1 12 -1, 12 15 16 -1, 5 16 15 -1, 12 0 15 -1, 18 13 2 -1, 13 18 17 -1, 3 17 18 -1, 17 0 13 -1, 20 17 3 -1, 17 20 19 -1, 4 19 20 -1, 19 0 17 -1, 21 19 4 -1, 19 21 15 -1, 5 15 21 -1, 15 0 19 -1, 23 1 16 -1, 16 22 23 -1, 10 23 22 -1, 22 16 5 -1, 25 2 14 -1, 14 24 25 -1, 6 25 24 -1, 24 14 1 -1, 27 3 18 -1, 18 26 27 -1, 7 27 26 -1, 26 18 2 -1, 29 4 20 -1, 20 28 29 -1, 8 29 28 -1, 28 20 3 -1, 31 5 21 -1, 21 30 31 -1, 9 31 30 -1, 30 21 4 -1, 32 23 10 -1, 23 32 24 -1, 6 24 32 -1, 24 1 23 -1, 33 25 6 -1, 25 33 26 -1, 7 26 33 -1, 26 2 25 -1, 34 27 7 -1, 27 34 28 -1, 8 28 34 -1, 28 3 27 -1, 35 29 8 -1, 29 35 30 -1, 9 30 35 -1, 30 4 29 -1, 36 31 9 -1, 31 36 22 -1, 10 22 36 -1, 22 5 31 -1, 38 6 32 -1, 32 37 38 -1, 11 38 37 -1, 37 32 10 -1, 39 7 33 -1, 33 38 39 -1, 11 39 38 -1, 38 33 6 -1, 40 8 34 -1, 34 39 40 -1, 11 40 39 -1, 39 34 7 -1, 41 9 35 -1, 35 40 41 -1, 11 41 40 -1, 40 35 8 -1, 37 10 36 -1, 36 41 37 -1, 11 37 41 -1, 41 36 9 -1 \">")
.arg("<Coordinate point=\"0 0 -1 0.7236 -0.52572 -0.447215 -0.276385 -0.85064 -0.447215 -0.894425 0 -0.447215 -0.276385 0.85064 -0.447215 0.7236 0.52572 -0.447215 0.276385 -0.85064 0.447215 -0.7236 -0.52572 0.447215 -0.7236 0.52572 0.447215 0.276385 0.85064 0.447215 0.894425 0 0.447215 0 0 1 0.425323 -0.309011 -0.850654 -0.162456 -0.499995 -0.850654 0.262869 -0.809012 -0.525738 0.425323 0.309011 -0.850654 0.850648 0 -0.525736 -0.52573 0 -0.850652 -0.688189 -0.499997 -0.525736 -0.162456 0.499995 -0.850654 -0.688189 0.499997 -0.525736 0.262869 0.809012 -0.525738 0.951058 0.309013 0 0.951058 -0.309013 0 0.587786 -0.809017 0 0 -1 0 -0.587786 -0.809017 0 -0.951058 -0.309013 0 -0.951058 0.309013 0 -0.587786 0.809017 0 0 1 0 0.587786 0.809017 0 0.688189 -0.499997 0.525736 -0.262869 -0.809012 0.525738 -0.850648 0 0.525736 -0.262869 0.809012 0.525738 0.688189 0.499997 0.525736 0.52573 0 0.850652 0.162456 -0.499995 0.850654 -0.425323 -0.309011 0.850654 -0.425323 0.309011 0.850654 0.162456 0.499995 0.850654\"/><ColorRGBA color=\"{x3dspherecol}\" /></IndexedFaceSet></Shape></Transform>]]></primitive>")
.arg("<primitive name=\"box\"><![CDATA[<Transform {x3dvectors}><Shape><IndexedFaceSet coordIndex=\"0 1 2 -1 0 2 4 -1 4 2 6 -1 4 7 5 -1 4 6 7 -1 1 3 2 -1 1 0 4 -1 1 4 5 -1 3 7 2 -1 2 7 6 -1 3 1 7 -1 7 1 5 -1\" solid=\"false\"><Coordinate point=\"{coords}\" /><ColorRGBA color=\"{r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha}\" /></IndexedFaceSet></Shape></Transform>]]></primitive>")
.arg("<primitive name=\"triangle\"><![CDATA[<Shape><IndexedFaceSet coordIndex=\"0 1 2 -1\" solid=\"false\"><Coordinate point=\"{p1x} {p1y} {p1z} {p2x} {p2y} {p2z} {p3x} {p3y} {p3z}\" /><ColorRGBA color=\"{r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha}\" /></IndexedFaceSet></Shape>]]></primitive>")
.arg("<primitive name=\"dot\"><![CDATA[<Shape><PointSet><Coordinate point=\"{x} {y} {z}\" /><ColorRGBA color=\"{r} {g} {b} {alpha}\"/></PointSet></Shape>]]></primitive>")
.arg("<primitive name=\"mesh\"><![CDATA[<Transform translation=\"{x3dtranslate}\"><Shape><IndexedFaceSet coordIndex=\"1 6 0 -1 0 6 5 -1 5 7 0 -1 0 7 2 -1 6 1 9 -1 1 8 9 -1 7 9 2 -1 2 9 8 -1\"><Coordinate point=\"{x3dcoord}\" /><ColorRGBA color=\"{r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha}\" /></IndexedFaceSet></Shape></Transform>]]></primitive> ")
.arg("</template>");
foreach(tt , types())
this->renderTemplate= "";
foreach(tt , types())
actionList << new QAction(filterName(tt), this);
//num=0;
}
@ -63,23 +53,10 @@ QString FilterSSynth::filterInfo(FilterIDType filterId) const
}
void FilterSSynth::initParameterSet(QAction* filter,MeshDocument &md, RichParameterSet &par)
{
RichOpenFile* opens=new RichOpenFile(tr("openfile"),tr(""),tr("*.*"),tr(""),tr(""),tr(""));
//FileDecoration * fc=new FileDecoration()
// RichSaveFile* saves=new RichSaveFile(tr("exportg"),v,)
//par.addParam(new RichOpenFile(QString("openf"),QString(""),QString(".es")));
//RichString* str=new RichString("oioin","","","");
//str->accept(opens->pd);
RichString* grammar=new RichString("grammar","set maxdepth 40 R1 R2 rule R1 { { x 1 rz 6 ry 6 s 0.99 } R1 { s 2 } sphere } rule R2 {{ x -1 rz 6 ry 6 s 0.99 } R2 { s 2 } sphere} ","Eisen Script grammar","Write a grammar according to Eisen Script specification and using the primitives box, sphere, mesh, dot and triangle ");
/*FileValue* v=new FileValue(tr("exportedgrammar"));
v->set(*(grammar->val));
FileDecoration* fc=new FileDecoration(v,tr("ES"),tr("Exported EisenScript grammar"),QString::Null());
RichSaveFile* saves=new RichSaveFile(tr("expg"),v,fc);*/
//par.addParam(new RichString("grammar","set maxdepth 40 R1 R2 rule R1 { { x 1 rz 6 ry 6 s 0.99 } R1 { s 2 } sphere } rule R2 {{ x -1 rz 6 ry 6 s 0.99 } R2 { s 2 } sphere} ","Eisen Script grammar","Write a grammar according to Eisen Script specification and using the primitives box, sphere, mesh, dot and triangle "));
par.addParam(grammar);
par.addParam(new RichInt("seed",1,"seed for random construction",""));
// par.addParam(saves);
return;
par.addParam(new RichString("grammar","set maxdepth 40 R1 R2 rule R1 { { x 1 rz 6 ry 6 s 0.99 } R1 { s 2 } sphere } rule R2 {{ x -1 rz 6 ry 6 s 0.99 } R2 { s 2 } sphere} ","Eisen Script grammar","Write a grammar according to Eisen Script specification and using the primitives box, sphere, mesh, dot and triangle "));
par.addParam(new RichInt("seed",1,"seed for random construction","Seed needed to build the mesh"));
par.addParam(new RichInt("sphereres",1,"set maximum resolution of sphere primitves, it must be included between 1 and 4","increasing the resolution of the spheres will improve the quality of the mesh "));
return;
}
void FilterSSynth::openX3D(const QString &fileName, MeshModel &m, int& mask, vcg::CallBackPos *cb, QWidget* parent)
{
@ -94,38 +71,38 @@ void FilterSSynth::openX3D(const QString &fileName, MeshModel &m, int& mask, vcg
}
bool FilterSSynth::applyFilter(QAction* filter, MeshDocument &md, RichParameterSet & par, vcg::CallBackPos *cb)
{
QWidget * parent=(QWidget*)this->parent();
RichParameter* grammar=par.findParameter(QString("grammar"));
RichParameter* seed=par.findParameter(QString("seed"));
QString path=ssynth(grammar->val->getString(),seed->val->getInt(),cb);
int sphereres=par.findParameter("sphereres")->val->getInt();
this->renderTemplate=GetTemplate(sphereres);
if(this->renderTemplate!=QString::Null()){
QString path=ssynth(grammar->val->getString(),-50,seed->val->getInt(),cb);
if(QFile::exists(path)){
QFile file(path);
//CMeshO cm=md.mm()->cm;
//MeshModel m=*(md.mm());
//grammars[m]=grammar->val->getString();
int mask;
const QString name(file.fileName());
openX3D(name,*(md.mm()),mask,cb);
file.remove();
return true;
}
else{
QWidget * parent=(QWidget*)this->parent();
QMessageBox::critical(parent,tr("Error"),tr("An error occurred during the mesh generation: ").append(path));
QString message=QString("An error occurred during the mesh generation:" ).append(path);
QMessageBox::critical(parent,"Error",message);
return false;
}
}
else{
QMessageBox::critical(parent,"Error","Sphere resolution must be between 1 and 4"); return false;
}
}
int FilterSSynth::getRequirements(QAction *)
{
return MeshModel::MM_NONE;
}
QString FilterSSynth::ssynth(QString grammar,int seed,CallBackPos *cb){
QString FilterSSynth::ssynth(QString grammar,int maxdepth,int seed,CallBackPos *cb){
QString path("");
QString tdir = QApplication::applicationDirPath();
// QFile filer(tdir.append(tr("/x3d.rendertemplate")));//il file per ora va messo nella cartella dove c'è l'eseguibile di meshlab
//if(filer.exists()){
if (cb != NULL) (*cb)(0, "Loading...");
//Template templ(filer);
if (cb != NULL) (*cb)(0, "Loading...");
Template templ(this->renderTemplate);
MyTrenderer renderer(templ);
renderer.begin();
@ -136,9 +113,10 @@ int FilterSSynth::getRequirements(QAction *)
try
{
RuleSet* rs=parser.parseRuleset();
if(maxdepth>0)
rs->setRulesMaxDepth(maxdepth);
rs->resolveNames();
rs->dumpInfo();
RandomStreams::SetSeed(seed);
Builder b(&renderer,rs,false);
b.build();
@ -158,8 +136,6 @@ int FilterSSynth::getRequirements(QAction *)
catch(ParseError& ex){
return ex.getMessage();
}
/*}
else path=QString("");*/
return path;
}
int FilterSSynth::postCondition(QAction* filter) const
@ -183,16 +159,16 @@ QList<MeshIOInterface::Format> FilterSSynth::importFormats() const
}
bool FilterSSynth::open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterSet & par, CallBackPos *cb, QWidget *parent)
{
//if (cb != NULL) (*cb)(0, "Loading...");
this->seed=par.findParameter("seed")->val->getInt();
int maxrec=par.findParameter("maxrec")->val->getInt();
int sphereres=par.findParameter("sphereres")->val->getInt();
this->renderTemplate=GetTemplate(sphereres);
if(this->renderTemplate!=QString::Null()){
QFile grammar(fileName);
grammar.open(QFile::ReadOnly|QFile::Text);
grammar.open(QFile::ReadOnly|QFile::Text);
QString gcontent(grammar.readAll());
grammar.close();
// CMeshO cm=m.cm;
// grammars[m]=gcontent;
QString x3dfile(FilterSSynth::ssynth(gcontent,this->seed,cb));
QString x3dfile(FilterSSynth::ssynth(gcontent,maxrec,this->seed,cb));
if(QFile::exists(x3dfile)){
openX3D(x3dfile,m,mask,cb);
QFile x3df(x3dfile);
@ -203,6 +179,8 @@ QList<MeshIOInterface::Format> FilterSSynth::importFormats() const
QMessageBox::critical(parent,tr("Error"),tr("An error occurred during the mesh generation: ").append(x3dfile));
return false;
}
}
else{ QMessageBox::critical(parent,"Error","Sphere resolution must be between 1 and 4"); return false;}
}
bool FilterSSynth::save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterSet &, vcg::CallBackPos *cb, QWidget *parent)
{
@ -210,9 +188,36 @@ QList<MeshIOInterface::Format> FilterSSynth::importFormats() const
}
void FilterSSynth::GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const{}
void FilterSSynth::initPreOpenParameter(const QString &formatName, const QString &filename, RichParameterSet &parlst){
parlst.addParam(new RichInt(tr("seed"),1,tr("Seed for random mesh generation")));
parlst.addParam(new RichInt(tr("seed"),1,tr("Seed for random mesh generation"),tr("write a seed for the random generation of the mesh")));
parlst.addParam(new RichInt("maxrec",0,"set the maximum recursion","the mesh is built recursively according to the productions of the grammar, so a limit is needed. If set to 0 meshlab will generate the mesh according to the maximum recursion set in the file"));
parlst.addParam(new RichInt("sphereres",1,"set maximum resolution of sphere primitves, it must be included between 1 and 4","increasing the resolution of the spheres will improve the quality of the mesh "));
}
QString FilterSSynth::GetTemplate(int sphereres){
QString filen;
switch(sphereres){
case 1:
filen=":/x3d.rendertemplate";
break;
case 2:
filen=":/x3d2.rendertemplate";
break;
case 3:
filen=":/x3d3.rendertemplate";
break;
case 4:
filen=":/x3d4.rendertemplate";
break;
default:
return QString::Null();
break;
}
QFile tr(filen);
tr.open(QFile::ReadOnly|QFile::Text);
QString templateR(tr.readAll());
return templateR;
}
Q_EXPORT_PLUGIN(FilterSSynth)

View File

@ -51,9 +51,7 @@ class FilterSSynth : public QObject,public MeshIOInterface, public MeshFilterInt
virtual FilterClass getClass(QAction* filter);
void setAttributes(CMeshO::VertexIterator &vi, CMeshO &m);
static void openX3D(const QString &fileName, MeshModel &m, int& mask, vcg::CallBackPos *cb, QWidget *parent=0);
virtual int postCondition(QAction* filter) const;
virtual int postCondition(QAction* filter) const;
QList<Format> importFormats() const;
QList<Format> exportFormats() const;
@ -64,8 +62,11 @@ class FilterSSynth : public QObject,public MeshIOInterface, public MeshFilterInt
bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterSet &, vcg::CallBackPos *cb, QWidget *parent);
private:
QString ssynth(QString grammar,int seed,vcg::CallBackPos *cb);
QString ssynth(QString grammar,int maxdepth,int seed,vcg::CallBackPos *cb);
QString GetTemplate(int sphereres);
// bool HasRec(QString *grammar);
int seed;
QString renderTemplate;
QString spheres[6];
};
#endif // FILTER_SSYNTH_H

View File

@ -15,8 +15,13 @@ win32-msvc2005:LIBS += ../../external/lib/win32-msvc2005/ssynth.lib
win32-msvc2008:LIBS += ../../external/lib/win32-msvc2008/ssynth.lib
win32-g++:LIBS += ../../external/lib/win32-gcc/libssynth.a
linux-g++:LIBS += ../../external/lib/linux-g++/libssynth.a
macx:DESTDIR = ../../external/lib/macx/libssynth.a
TARGET = filter_ssynth
TEMPLATE = lib
QT += opengl
CONFIG += plugin
OTHER_FILES +=
OTHER_FILES += x3d.rendertemplate \
x3d2.rendertemplate \
x3d3.rendertemplate \
x3d4.rendertemplate
RESOURCES += ssynthres.qrc

View File

@ -41,12 +41,12 @@ void MyTrenderer::drawSphere(SyntopiaCore::Math::Vector3f center, float radius,
QString scale=QString("%1 %2 %3")
.arg(diff).arg(diff).arg(diff);
t.substitute("{x3dsphscale}",scale);
QString colors("");
for(int i=0;i<126;i++){
colors.append(QString::number(rgb.x())).append(" ").append(QString::number(rgb.y())).append(" ").append(QString::number(rgb.z())).append(" ").append(QString::number(alpha)).append(" ");
}
t.substitute("{x3dspherecol}",colors);
}
t.substitute("{r}", QString::number(rgb.x()));
t.substitute("{g}", QString::number(rgb.y()));
t.substitute("{b}", QString::number(rgb.z()));
t.substitute("{alpha}", QString::number(alpha));
t.substitute("{rad}", QString::number(radius));
output.append(t.getText());
}

View File

@ -0,0 +1,8 @@
<RCC>
<qresource prefix="/">
<file>x3d.rendertemplate</file>
<file>x3d2.rendertemplate</file>
<file>x3d3.rendertemplate</file>
<file>x3d4.rendertemplate</file>
</qresource>
</RCC>

View File

@ -21,7 +21,7 @@
<Shape>
<IndexedFaceSet solid="true" coordIndex="14 12 1 -1, 12 14 13 -1, 2 13 14 -1, 13 0 12 -1, 16 1 12 -1, 12 15 16 -1, 5 16 15 -1, 12 0 15 -1, 18 13 2 -1, 13 18 17 -1, 3 17 18 -1, 17 0 13 -1, 20 17 3 -1, 17 20 19 -1, 4 19 20 -1, 19 0 17 -1, 21 19 4 -1, 19 21 15 -1, 5 15 21 -1, 15 0 19 -1, 23 1 16 -1, 16 22 23 -1, 10 23 22 -1, 22 16 5 -1, 25 2 14 -1, 14 24 25 -1, 6 25 24 -1, 24 14 1 -1, 27 3 18 -1, 18 26 27 -1, 7 27 26 -1, 26 18 2 -1, 29 4 20 -1, 20 28 29 -1, 8 29 28 -1, 28 20 3 -1, 31 5 21 -1, 21 30 31 -1, 9 31 30 -1, 30 21 4 -1, 32 23 10 -1, 23 32 24 -1, 6 24 32 -1, 24 1 23 -1, 33 25 6 -1, 25 33 26 -1, 7 26 33 -1, 26 2 25 -1, 34 27 7 -1, 27 34 28 -1, 8 28 34 -1, 28 3 27 -1, 35 29 8 -1, 29 35 30 -1, 9 30 35 -1, 30 4 29 -1, 36 31 9 -1, 31 36 22 -1, 10 22 36 -1, 22 5 31 -1, 38 6 32 -1, 32 37 38 -1, 11 38 37 -1, 37 32 10 -1, 39 7 33 -1, 33 38 39 -1, 11 39 38 -1, 38 33 6 -1, 40 8 34 -1, 34 39 40 -1, 11 40 39 -1, 39 34 7 -1, 41 9 35 -1, 35 40 41 -1, 11 41 40 -1, 40 35 8 -1, 37 10 36 -1, 36 41 37 -1, 11 37 41 -1, 41 36 9 -1 ">
<Coordinate point="0 0 -1 0.7236 -0.52572 -0.447215 -0.276385 -0.85064 -0.447215 -0.894425 0 -0.447215 -0.276385 0.85064 -0.447215 0.7236 0.52572 -0.447215 0.276385 -0.85064 0.447215 -0.7236 -0.52572 0.447215 -0.7236 0.52572 0.447215 0.276385 0.85064 0.447215 0.894425 0 0.447215 0 0 1 0.425323 -0.309011 -0.850654 -0.162456 -0.499995 -0.850654 0.262869 -0.809012 -0.525738 0.425323 0.309011 -0.850654 0.850648 0 -0.525736 -0.52573 0 -0.850652 -0.688189 -0.499997 -0.525736 -0.162456 0.499995 -0.850654 -0.688189 0.499997 -0.525736 0.262869 0.809012 -0.525738 0.951058 0.309013 0 0.951058 -0.309013 0 0.587786 -0.809017 0 0 -1 0 -0.587786 -0.809017 0 -0.951058 -0.309013 0 -0.951058 0.309013 0 -0.587786 0.809017 0 0 1 0 0.587786 0.809017 0 0.688189 -0.499997 0.525736 -0.262869 -0.809012 0.525738 -0.850648 0 0.525736 -0.262869 0.809012 0.525738 0.688189 0.499997 0.525736 0.52573 0 0.850652 0.162456 -0.499995 0.850654 -0.425323 -0.309011 0.850654 -0.425323 0.309011 0.850654 0.162456 0.499995 0.850654"/>
<ColorRGBA color="{x3dspherecol}" />
<ColorRGBA color="{r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} " />
</IndexedFaceSet>
</Shape>
</Transform>
@ -42,6 +42,7 @@
<![CDATA[<Shape>
<IndexedFaceSet coordIndex="0 1 2 -1" solid="false" >
<Coordinate point="{p1x} {p1y} {p1z} {p2x} {p2y} {p2z} {p3x} {p3y} {p3z}" />
<ColorRGBA color="{r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha}" />
</IndexedFaceSet>
</Shape>
]]>
@ -63,28 +64,6 @@
<ColorRGBA color="{r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha}" />
</IndexedFaceSet>
</Shape>
</Transform>
]]>
</Transform>]]>
</primitive>
<primitive name="line">
<![CDATA[
<Shape>
<IndexedLineSet coordIndex="0 1 -1">
<Coordinate point="{x1} {y1} {z1} {x2} {y2} {z2}" />
<ColorRGBA color="{alpha}" />
</IndexedLineSet>
</Shape>
]]>
</primitive>
<!--<primitive name="grid">
<![CDATA[<Transform {x3dvectors}>
<Shape>
<IndexedLineSet coordIndex="0 1 2 -1 0 2 4 -1 4 2 6 -1 4 7 5 -1 4 6 7 -1 1 3 2 -1 1 0 4 -1 1 4 5 -1 3 7 2 -1 2 7 6 -1 3 1 7 -1 7 1 5 -1" solid="false">
<Coordinate point="{coords}" />
<ColorRGBA color="{r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha} {r} {g} {b} {alpha}" />
</IndexedLineSet>
</Shape>
</Transform>
]]>
</primitive>-->
</template>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long