Difference between pages "ConvertStrToVector MEL" and "GenerateMultiOffCurveTangToCurve"
From scripting
(Difference between pages)
(Created page with " global proc vector ConvertStrToVector(string $CurStr) { //0001D LLC 2015 Nick Pisca //string $CurStr = "234.32,332.043"; string $DestUVs[]; $numTokens = `tokenize $Cu...") |
(Created page with " global proc string GenerateMultiOffCurveTangToCurve(vector $Pt1, vector $Pt1Close, vector $Pt2, float $OffDist, string $NameStr) { vector $MidVec = OffMidVector($Pt1, $...") |
||
Line 1: | Line 1: | ||
− | global proc vector | + | global proc string GenerateMultiOffCurveTangToCurve(vector $Pt1, vector $Pt1Close, vector $Pt2, float $OffDist, string $NameStr) { |
− | + | vector $MidVec = [[OffMidVector]]($Pt1, $Pt2, $OffDist); | |
− | + | vector $MidVec2 = [[OffMidVector]]($Pt1, $Pt2, $OffDist); | |
− | + | vector $MidVec3 = [[OffMidVector]]($Pt1, $Pt2, $OffDist); | |
− | $ | + | vector $M2 = [[OffMidVector]]($MidVec, $Pt2, 0.01); |
− | + | //string $Curv = `curve -d 3 -p ($Pt1.x) ($Pt1.y) ($Pt1.z) -p ($Pt1Close.x) ($Pt1Close.y) ($Pt1Close.z) -p ($MidVec.x) ($MidVec.y) ($MidVec.z) -p ($M2.x) ($M2.y) ($M2.z) -p ($Pt2.x) ($Pt2.y) ($Pt2.z) -k 0 -k 0 -k 0 -k 1 -k 2 -k 2 -k 2 -n ($NameStr)`; | |
− | return $ | + | string $Curv = `curve -d 3 -p ($Pt1.x) ($Pt1.y) ($Pt1.z) -p ($Pt1Close.x) ($Pt1Close.y) ($Pt1Close.z) -p ($MidVec2.x) ($MidVec2.y) ($MidVec2.z) -p ($MidVec3.x) ($MidVec3.y) ($MidVec3.z) -p ($MidVec.x) ($MidVec.y) ($MidVec.z) -p ($M2.x) ($M2.y) ($M2.z) -p ($Pt2.x) ($Pt2.y) ($Pt2.z) -k 0 -k 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 4 -k 4 -n ($NameStr)`; |
+ | return $Curv; | ||
} | } | ||
− | ''More information on vectors and | + | |
+ | ''More information on vectors and vector mathematics, read pages 14-16, 20-21 in [http://stores.lulu.com/nickpisca YSYT]. | ||
[[Category:MEL]] | [[Category:MEL]] |
Latest revision as of 05:36, 22 April 2017
global proc string GenerateMultiOffCurveTangToCurve(vector $Pt1, vector $Pt1Close, vector $Pt2, float $OffDist, string $NameStr) { vector $MidVec = OffMidVector($Pt1, $Pt2, $OffDist); vector $MidVec2 = OffMidVector($Pt1, $Pt2, $OffDist); vector $MidVec3 = OffMidVector($Pt1, $Pt2, $OffDist); vector $M2 = OffMidVector($MidVec, $Pt2, 0.01); //string $Curv = `curve -d 3 -p ($Pt1.x) ($Pt1.y) ($Pt1.z) -p ($Pt1Close.x) ($Pt1Close.y) ($Pt1Close.z) -p ($MidVec.x) ($MidVec.y) ($MidVec.z) -p ($M2.x) ($M2.y) ($M2.z) -p ($Pt2.x) ($Pt2.y) ($Pt2.z) -k 0 -k 0 -k 0 -k 1 -k 2 -k 2 -k 2 -n ($NameStr)`; string $Curv = `curve -d 3 -p ($Pt1.x) ($Pt1.y) ($Pt1.z) -p ($Pt1Close.x) ($Pt1Close.y) ($Pt1Close.z) -p ($MidVec2.x) ($MidVec2.y) ($MidVec2.z) -p ($MidVec3.x) ($MidVec3.y) ($MidVec3.z) -p ($MidVec.x) ($MidVec.y) ($MidVec.z) -p ($M2.x) ($M2.y) ($M2.z) -p ($Pt2.x) ($Pt2.y) ($Pt2.z) -k 0 -k 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 4 -k 4 -n ($NameStr)`; return $Curv; }
More information on vectors and vector mathematics, read pages 14-16, 20-21 in YSYT.