Just want to know the big picture. If anyone have a clue and can point me at a direction im all ears

To add points in the curve we can use SIAddPointOnCurveAtEnd .SICreateCurve( [Name], [Degree], [CurveType] )
SIAddPointOnCurveAtEnd( InputObj, [X], [Y], [Z], [Local], [CurveType], [PreserveTrace] )
Following script generates a curve that is actually a str8 line of lenght 1000 with 1001 points.SISetCurvePoints( InputObj, [Points], [Local] )
Code: Select all
var pointslist = "(0,0,0)";
for (i=1; i<=1000; i++){
pointslist+=",("+i+",0,0)";
}
LogMessage(pointslist);
crv=SICreateCurve("Linear_Curve_Line", 1, 1);
SISetCurvePoints( crv, pointslist, false );
Hey FXDude, not expert on ICE or strands here but actually anything could help and it looks promising thanx! Even if its not a solution that converts Softimage magically to a full CAD programm, it could help to create some strand / curve primitive generators, the live part sounds interesting and on screen info is nice as well. As rray said im not sure if i can set all those fancy CAD-ish contraints, to define my shape, or have that 'evrything is solved on the fly functionality', Ill have to try and see its limitations.FXDude wrote: ↑31 Dec 2017, 22:57Hi!
Perhaps this could also be of help? ::
http://andy.moonbase.net/archives/940
Which can also be applied to strands and then (parametrically live) curves (with Strands to Curves)
Code: Select all
//Linear Curves Parametric Square V0.12
var SqSL=4; //Side Lenght
var div=4; //Divisions (Sections per Side)
///// Calcs
var sL=SqSL/div;//Section lenght.
var h=SqSL/2; //half side
var tip=[-h,-h]; //tip of our "pen" starting possition
var Area=Math.pow(SqSL,2); //Area
var Hypo=Math.sqrt(2*Area); //Hypotenuse
var pointslist=""; //point positions for curve (string)
if(div>0){
for(i=1; i<=4; i++){
if (i===1){
for(j=1; j<=div; j++){
pointslist+="("+tip[0]+","+tip[1]+",0),";
tip[0]+=sL;
}
}
if (i===2){
for(k=1; k<=div; k++){
pointslist+="("+tip[0]+","+tip[1]+",0),";
tip[1]+=sL;
}
}
if (i===3){
for(l=1; l<=div; l++){
pointslist+="("+tip[0]+","+tip[1]+",0),";
tip[0]-=sL;
}
}
if (i===4){
for(m=1; m<=div; m++){
pointslist+="("+tip[0]+","+tip[1]+",0),";
tip[1]-=sL;
}
}
}
pointslist=pointslist.slice(0,-1);
crv=SICreateCurve("Linear_Curve_Square", 1, 1);
SISetCurvePoints( crv, pointslist, false );
ApplyTopoOp("CrvOpenClose", crv, 3, siPersistentOperation, null);
LogMessage("Succesfully created a Linear Curve Square.\n"+div+" divisions per side.\nSide lenght:"+SqSL+"\nSection Lenght="+sL+"\nHypotenuse:"+Hypo+"\nArea:"+Area);
}
else{LogMessage("Error, Divisions to 1 or more" );
}
Bellow is the square code put in a loop 4 times + every point is moved to z a certain value, then added a smooth op// INFO : Succesfully created a Linear Curve Square.
// 250 divisions per side.
// Side lenght:4
// Section Lenght=0.016
// Hypotenuse:5.656854249492381
// Area:16
Code: Select all
//JS
positions = "(0,0,0), (0,1,0), (1,1,0), (1,0,0), (0,0,0)"
crv = CreateCurve( 1, 0, positions, false)('Value')
LogMessage ( crv )
It should be possible to store the result of the creatae curve command in a varibable and then use this variable instead of the curve name in the add points function
Users browsing this forum: No registered users and 1 guest