XForm Change Basis


#1

Hi there,

Some starter questions about RS XformChangeBasis, I guess they are pretty straightforward

I would like to use the command similar to the Rhino Orient3Pt Command, and suppose, this is just what it should do?!

Creating Normal Planes from 2 random lines and wanting to transform the End Point of the first line to the second plane (obviously resulting in a point along or on the extension of the second line), I can’t get the correct result.

Is this some simple problem with my code (vector maths?!) or do I just misunderstand the XformChangeBasis function.

Any suggestions are really appreciated;
K.

Dim arrPOINT
	Dim arrPLANEREFERENCE,arrPLANETARGET
	Dim strNORMAL1, strNORMAL2
	Dim arrTRANSFORMATION
	
	strNORMAL1 = Rhino.GetCurveObject("Select Normal Vector Reference")(0)
	strNORMAL2 = Rhino.GetCurveObject("Select Normal Vector Target ")(0)
	
	arrPOINT = Rhino.VectorCreate(Rhino.CurveEndPoint(strNORMAL1), Rhino.CurveStartPoint(strNORMAL1))
	arrPOINT = Rhino.VectorAdd(Rhino.CurveStartPoint(strNORMAL1), arrPOINT)
	Call Rhino.AddPoint(arrPOINT)
	
	arrPLANEREFERENCE = Rhino.PlanefromNormal(Rhino.CurveStartPoint(strNORMAL1),   Rhino.VectorCreate(Rhino.CurveEndPoint(strNORMAL1), Rhino.CurveStartPoint(strNORMAL1)))
	arrPLANETARGET = Rhino.PlanefromNormal(Rhino.CurveStartPoint(strNORMAL2), Rhino.VectorCreate(Rhino.CurveEndPoint(strNORMAL2), Rhino.CurveStartPoint(strNORMAL2)))
	arrTRANSFORMATION = Rhino.XformchangeBasis(arrPLANEREFERENCE, arrPLANETARGET)
	
	arrPOINT = Rhino.VectorTransform(arrPOINT, arrTRANSFORMATION)
	Call Rhino.AddPoint(arrPOINT)
	

(Pascal Golay) #2

Try XFormRotation for this, with the two planes as input.

-Pascal