[brlcad-commits] SF.net SVN: brlcad:[35915] brlcad/trunk/src/librt/primitives/rhc/rhc_brep. cpp
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2009-09-16 03:01:28
|
Revision: 35915 http://brlcad.svn.sourceforge.net/brlcad/?rev=35915&view=rev Author: starseeker Date: 2009-09-16 03:01:21 +0000 (Wed, 16 Sep 2009) Log Message: ----------- Close, but no cigar. Also won't handle non-axis-aligned cases out of the box - scaling factor distorts control point and 'tilts' surface. May need to 'pre-correct' control point so scaling puts it in the right place. Modified Paths: -------------- brlcad/trunk/src/librt/primitives/rhc/rhc_brep.cpp Modified: brlcad/trunk/src/librt/primitives/rhc/rhc_brep.cpp =================================================================== --- brlcad/trunk/src/librt/primitives/rhc/rhc_brep.cpp 2009-09-16 02:16:26 UTC (rev 35914) +++ brlcad/trunk/src/librt/primitives/rhc/rhc_brep.cpp 2009-09-16 03:01:21 UTC (rev 35915) @@ -80,8 +80,8 @@ VREVERSE(x_rev_dir, x_dir); VADD2(ep1, p1_origin, x_rev_dir); - double w1 = 1/(1-(MAGNITUDE(eip->rhc_B)/(MAGNITUDE(eip->rhc_B)+eip->rhc_c))); - VSCALE(tmppt, eip->rhc_B, 2 * (MAGNITUDE(eip->rhc_B)+eip->rhc_c)/MAGNITUDE(eip->rhc_B)); + double w1 = (MAGNITUDE(eip->rhc_B)/(MAGNITUDE(eip->rhc_B)+eip->rhc_c))/(1-(MAGNITUDE(eip->rhc_B)/(MAGNITUDE(eip->rhc_B)+eip->rhc_c))); + VSCALE(tmppt, eip->rhc_B, w1 * (MAGNITUDE(eip->rhc_B)+eip->rhc_c)/MAGNITUDE(eip->rhc_B)); VADD2(ep2, p1_origin, tmppt); VADD2(ep3, p1_origin, x_dir); ON_3dPoint onp1 = ON_3dPoint(ep1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |