Difference between pages "GenerateMultiOffCurveTangToCurve" and "GenerateOffCurve"

From scripting
(Difference between pages)
Jump to: navigation, search
(Created page with " global proc string GenerateMultiOffCurveTangToCurve(vector $Pt1, vector $Pt1Close, vector $Pt2, float $OffDist, string $NameStr) { vector $MidVec = OffMidVector($Pt1, $...")
 
(Created page with " global proc string GenerateOffCurve(vector $Pt1, vector $Pt2, float $OffDist, string $NameStr) { vector $MidVec = OffMidVector($Pt1, $Pt2, $OffDist); vector $M1 = O...")
 
Line 1: Line 1:
  global proc string GenerateMultiOffCurveTangToCurve(vector $Pt1, vector $Pt1Close, vector $Pt2, float $OffDist, string $NameStr) {
+
  global proc string GenerateOffCurve(vector $Pt1, vector $Pt2, float $OffDist, string $NameStr) {
 
  vector $MidVec = [[OffMidVector]]($Pt1, $Pt2, $OffDist);
 
  vector $MidVec = [[OffMidVector]]($Pt1, $Pt2, $OffDist);
  vector $MidVec2 = [[OffMidVector]]($Pt1, $Pt2, $OffDist);
+
  vector $M1 = [[OffMidVector]]($MidVec, $Pt1, 0.01);
vector $MidVec3 = [[OffMidVector]]($Pt1, $Pt2, $OffDist);
 
 
  vector $M2 = [[OffMidVector]]($MidVec, $Pt2, 0.01);
 
  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 ($M1.x) ($M1.y) ($M1.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;
 
  return $Curv;
 
  }
 
  }
  
  
 +
Old Versions...
 +
 +
global proc string GenerateOffCurve(vector $Pt1, vector $Pt2, float $OffDist) {
 +
vector $MidVec = [[OffMidVector]]($Pt1, $Pt2, $OffDist);
 +
vector $M1 = [[OffMidVector]]($MidVec, $Pt1, 0.01);
 +
vector $M2 = [[OffMidVector]]($MidVec, $Pt2, 0.01);
 +
string $Curv[] = `curve -d 3 -p ($Pt1.x) ($Pt1.y) ($Pt1.z) -p ($M1.x) ($M1.y) ($M1.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 `;
 +
 +
return $Curv[0];
 +
}
  
  
 
''More information on vectors and vector mathematics, read pages 14-16, 20-21 in [http://stores.lulu.com/nickpisca YSYT].   
 
''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:37, 22 April 2017

global proc string GenerateOffCurve(vector $Pt1, vector $Pt2, float $OffDist, string $NameStr) {
	vector $MidVec = OffMidVector($Pt1, $Pt2, $OffDist);
	vector $M1 = OffMidVector($MidVec, $Pt1, 0.01);
	vector $M2 = OffMidVector($MidVec, $Pt2, 0.01);
	string $Curv = `curve -d 3 -p ($Pt1.x) ($Pt1.y) ($Pt1.z) -p ($M1.x) ($M1.y) ($M1.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 $Curv;
}


Old Versions...

global proc string GenerateOffCurve(vector $Pt1, vector $Pt2, float $OffDist) { 
	vector $MidVec = OffMidVector($Pt1, $Pt2, $OffDist);
	vector $M1 = OffMidVector($MidVec, $Pt1, 0.01);
	vector $M2 = OffMidVector($MidVec, $Pt2, 0.01);
	string $Curv[] = `curve -d 3 -p ($Pt1.x) ($Pt1.y) ($Pt1.z) -p ($M1.x) ($M1.y) ($M1.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 `;
	
	return $Curv[0];
}


More information on vectors and vector mathematics, read pages 14-16, 20-21 in YSYT.