gear_mc
 All Classes Namespaces Functions Variables
Functions
gear.xsi.curve Namespace Reference

create, merge, split curves... More...

Functions

def addCnsCurve
 DRAW. More...
 
def addCurve
 Create a NurbsCurve with a single subcurve. More...
 
def addCurve2
 Create a NurbsCurve with multiple subcurve. More...
 
def addCurveFromPos
 Create a NurbsCurve with a single subcurve from a list of position. More...
 
def mergeCurves
 SUBCURVES. More...
 
def splitCurve
 Split the sub curve of given curve. More...
 
def isClosed
 Return true if the given nurbscurve is closed. More...
 
def applyCurveResamplerOp
 OPERATOR. More...
 
def getGlobalPositionFromPercentage
 EVAL CURVE. More...
 
def getClosestU
 
def getClosestPercentage
 
def getClosestGlobalTransform
 
def getClosestGlobalPosition
 
def getClosestGlobalTangent
 
def getClosestGlobalNormal
 
def getClosestGlobalBiNormal
 
def getGlobalPointPosition
 

Detailed Description

create, merge, split curves...

    This file is part of GEAR_mc.
    GEAR_mc is a fork of Jeremie Passerin's GEAR project.

    GEAR is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/lgpl.html>.

    Author:     Jeremie Passerin    geerem@hotmail.com  www.jeremiepasserin.com
    Fork Author:  Miquel Campos       hello@miqueltd.com  www.miqueltd.com
    Date:       2013 / 08 / 16
Author
Jeremie Passerin

Function Documentation

def gear.xsi.curve.addCnsCurve (   parent,
  name,
  centers,
  close = False,
  degree = 1 
)

DRAW.

======================================================== Create a curve attached to given centers. One point per center.
Do to so we use a cluster center operator per point. We could use an envelope (method to do so is in the code), but there was a reason I can't remember why it was better to use clustercenter.

Parameters
parentX3DObject - Parent object.
nameString - Name.
centersList of X3DObject or Collection - Object that will drive the curve.
closeBoolean - True to close the fcurve.
degreeInteger - 1 for linear curve, 3 for Cubic.
Returns
NurbCurve - The newly created curve.
def gear.xsi.curve.addCurve (   parent,
  name,
  points,
  close = False,
  degree = 1,
  t = XSIMath.CreateTransform(),
  color = [0 
)

Create a NurbsCurve with a single subcurve.

Parameters
parentX3DObject - Parent object.
nameString - Name.
pointsList of Double - positions of the curve in a one dimension array [point0X, point0Y, point0Z, 1, point1X, point1Y, point1Z, 1, ...].
closeBoolean - True to close the curve.
degreeInteger - 1 for linear curve, 3 for Cubic.
tSITransformation - Global transform.
colorList of Double - The RGB color of the Null (ie. [1,0,0] for red).
Returns
NurbCurve - The newly created curve.
def gear.xsi.curve.addCurve2 (   parent,
  name,
  points,
  ncp = [],
  kn = [],
  nkn = [],
  close = [],
  degree = [],
  t = XSIMath.CreateTransform(),
  color = [0 
)

Create a NurbsCurve with multiple subcurve.

Parameters
parentX3DObject - Parent object.
nameString - Name.
pointsList of Double - positions of the curve in a one dimension array [point0X, point0Y, point0Z, 1, point1X, point1Y, point1Z, 1, ...].
ncpList of Double - See XSI SDK Docv for AddNurbsCurveList2.
knList of Double - See XSI SDK Docv for AddNurbsCurveList2.
nknList of Double - See XSI SDK Docv for AddNurbsCurveList2.
closeList of Boolean - True to close the curve.
degreeList of Integer - 1 for linear curve, 3 for Cubic.
tSITransformation - Global transform.
colorList of Double - The RGB color of the Null (ie. [1,0,0] for red).
Returns
NurbCurve - The newly created curve.
def gear.xsi.curve.addCurveFromPos (   parent,
  name,
  positions,
  close = False,
  degree = 1,
  knotsPara = c.siNonUniformParameterization,
  t = XSIMath.CreateTransform(),
  color = [0 
)

Create a NurbsCurve with a single subcurve from a list of position.

Parameters
parentX3DObject - Parent object.
nameString - Name.
positionsList of SIVector3 - positions of the curve points.
closeBoolean - True to close the curve.
degreeInteger - 1 for linear curve, 3 for Cubic.
knotsPara- knots parametrization in the curve
tSITransformation - Global transform.
colorList of Double - The RGB color of the object (ie. [1,0,0] for red).
Returns
NurbCurve - The newly created curve.
def gear.xsi.curve.applyCurveResamplerOp (   curve)

OPERATOR.

Apply Curve Resampler Op =============================== Resample the curve on itself, code of the operator is in the plugin sn_CurveTools

Parameters
curveNurbsCurve - The curve to resample.
Returns
Operator
def gear.xsi.curve.getGlobalPositionFromPercentage (   percentage,
  crv,
  subcurve = 0 
)

EVAL CURVE.

========================================================

def gear.xsi.curve.isClosed (   nurbscrv)

Return true if the given nurbscurve is closed.

Parameters
nurbscrvNurbsCurve - The nurbs curves to check.
Returns
Boolean.
def gear.xsi.curve.mergeCurves (   curves)

SUBCURVES.

Merge Curves =========================================== Merge given curve in one unique curve.

Parameters
curveList of NurbsCurve - The curves to merge.
Returns
NurbsCurve.
def gear.xsi.curve.splitCurve (   curve)

Split the sub curve of given curve.

Parameters
curveNurbsCurve - The curves to split.
Returns
List of NurbsCurve.