PDA

View Full Version : Julienne Problems!



Fasty
01-25-2004, 03:26 AM
Ok I've got a four point polygon on the x axis. I want to subdivide the polygon to use as a sail, so I click on Julenne and the Julenne window opens but now layer 7 is selected rather than layer one. I type in the number 12 and select the x axis and hit OK.

Nothing.

Layer 7 is still selected and nothing has happened to my four point polygon. I have installed Lightwave many times over the years and I can only remember Julienne NOT doing this one or two times.

Can anyone help?

cagey5
01-25-2004, 04:39 AM
I've just tried it and get the same result! Julienne is not a tool I use much but I think whenever I have I have always used it on a three dimentional object rather than a flat poly as it works fine with a box but not a flat plane.

If you extrude it, julienne, then delete the unwanted polys it should egt you there, but I must admit I was surprised by the limitation.

Fasty
01-25-2004, 04:50 AM
Thanks for confirming the error, cagey5. In the end I had to create the julienne effect manually by cloning some polygons and using the solid drill> stencil function. Very frustrating.

faulknermano
01-25-2004, 08:26 AM
@name fmJulienne
@warnings 0
@define LO 1
@define HI 2

main
{
selmode(USER);

polyc = polycount();
if(polyc[1] == 0)
error("<br>No data.");

segx = 1;
segy = 1;
segz = 1;
spacing = <1,1,1>;
segmode = integer(recall("segmode",1));
layerfg = lyrfg();
layerempty = lyrempty();

if(layerfg.size() > 1)
error("<br>Select one layer.");

datalayer = layerfg[1];
emptylayer = layerempty[1];


reqbegin("fm Julienne");
c1 = ctlchoice("Mode",segmode,@"By Segment","By Spacing"@);
c2a = ctlinteger("Segments X",segx);
c2b = ctlinteger("Segments Y",segy);
c2c = ctlinteger("Segments Z",segz);
c3 = ctlvector("Spacing XYZ \(m\)",spacing);
ctlactive(c1,"c2_active",c2a,c2b,c2c);
ctlactive(c1,"c3_active",c3);

return if(!reqpost());

segmode = getvalue(c1);
segx = getvalue(c2a);
segy = getvalue(c2b);
segz = getvalue(c2c);
spacing = getvalue(c3);

reqend();

segxyz = <segx,segy,segz>;

bb = boundingbox(datalayer);
lyrsetfg(emptylayer);
editbegin();

if(segmode == 1) // by segment
{
pc = 0;
bbtot = <(bb[2].x - bb[1].x),(bb[2].y - bb[1].y),(bb[2].z - bb[1].z)>;
spc = <bbtot.x / segxyz.x,bbtot.y / segxyz.y,bbtot.z / segxyz.z>;

for(j=1;j<=3;j++) // per axis
{

if(j == 1)
seg = segx;
if(j == 2)
seg = segy;
if(j == 3)
seg = segz;

if(seg <= 1)
continue;
for(i=1;i<seg;i++)
{
if(j == 1) // X axis
{
a[1] = addpoint(<bb[LO].x + (spc.x * i),bb[LO].y - 0.1,bb[LO].z - 0.1>);
a[2] = addpoint(<bb[LO].x + (spc.x * i),bb[HI].y + 0.1,bb[LO].z - 0.1>);
a[3] = addpoint(<bb[LO].x + (spc.x * i),bb[HI].y + 0.1,bb[HI].z + 0.1>);
a[4] = addpoint(<bb[LO].x + (spc.x * i),bb[LO].y - 0.1,bb[HI].z + 0.1>);
}
if(j == 2) // Y Axis
{
a[1] = addpoint(<bb[LO].x - 0.1,bb[LO].y + (spc.y * i),bb[LO].z - 0.1>);
a[2] = addpoint(<bb[HI].x + 0.1,bb[LO].y + (spc.y * i),bb[LO].z - 0.1>);
a[3] = addpoint(<bb[HI].x + 0.1,bb[LO].y + (spc.y * i),bb[HI].z + 0.1>);
a[4] = addpoint(<bb[LO].x - 0.1,bb[LO].y + (spc.y * i),bb[HI].z + 0.1>);


}
if(j == 3) // Z Axis
{
a[1] = addpoint(<bb[LO].x - 0.1,bb[LO].y - 0.1,bb[LO].z + (spc.z * i)>);
a[2] = addpoint(<bb[HI].x + 0.1,bb[LO].y - 0.1,bb[LO].z + (spc.z * i)>);
a[3] = addpoint(<bb[HI].x + 0.1,bb[HI].y + 0.1,bb[LO].z + (spc.z * i)>);
a[4] = addpoint(<bb[LO].x - 0.1,bb[HI].y + 0.1,bb[LO].z + (spc.z * i)>);
}
p[++pc] = addquad(a);
a = nil;

}
}
editend();
lyrsetfg(datalayer);
lyrsetbg(emptylayer);
soliddrill(SLICE);
lyrsetfg(emptylayer);
delete();
lyrsetfg(datalayer);

}
if(segmode == 2) // by spacing
{
for(j=1;j<=3;j++) // per axis
{
for(i=1;i<seg;i++)
{
if(j == 1) // X axis
{
a[1] = addpoint(<bb[LO].x + (spc.x * i),bb[LO].y - 0.1,bb[LO].z - 0.1>);
a[2] = addpoint(<bb[LO].x + (spc.x * i),bb[HI].y + 0.1,bb[LO].z - 0.1>);
a[3] = addpoint(<bb[LO].x + (spc.x * i),bb[HI].y + 0.1,bb[HI].z + 0.1>);
a[4] = addpoint(<bb[LO].x + (spc.x * i),bb[LO].y - 0.1,bb[HI].z + 0.1>);
}
if(j == 2) // Y Axis
{
a[1] = addpoint(<bb[LO].x - 0.1,bb[LO].y + (spc.y * i),bb[LO].z - 0.1>);
a[2] = addpoint(<bb[HI].x + 0.1,bb[LO].y + (spc.y * i),bb[LO].z - 0.1>);
a[3] = addpoint(<bb[HI].x + 0.1,bb[LO].y + (spc.y * i),bb[HI].z + 0.1>);
a[4] = addpoint(<bb[LO].x - 0.1,bb[LO].y + (spc.y * i),bb[HI].z + 0.1>);


}
if(j == 3) // Z Axis
{
a[1] = addpoint(<bb[LO].x - 0.1,bb[LO].y - 0.1,bb[LO].z + (spc.z * i)>);
a[2] = addpoint(<bb[HI].x + 0.1,bb[LO].y - 0.1,bb[LO].z + (spc.z * i)>);
a[3] = addpoint(<bb[HI].x + 0.1,bb[HI].y + 0.1,bb[LO].z + (spc.z * i)>);
a[4] = addpoint(<bb[LO].x - 0.1,bb[HI].y + 0.1,bb[LO].z + (spc.z * i)>);
}
p[++pc] = addquad(a);
a = nil;

}
}
editend();
lyrsetfg(datalayer);
lyrsetbg(emptylayer);
soliddrill(SLICE);
lyrsetfg(emptylayer);
delete();
lyrsetfg(datalayer);

}


}
c2_active: val
{
if(val == 1)
return(true);
else
return(false);
}

c3_active: val
{
if(val == 2)
return(true);
else
return(false);
}


please note that only the BY SEGMENT option is the only thing working. i'm sure someone who knows lscript can finish the rest for this script or add new stuff in it.

Fasty
01-25-2004, 04:57 PM
Many, many thanks! About to test the script now :)

Edit: Thanks again, it works like a charm! Faster than the original Julienne, too!