/[libvob]/libvob/include/vob/geom/Fillets2.hxx
ViewVC logotype

Diff of /libvob/include/vob/geom/Fillets2.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.31 by jvk, Sat Jul 5 11:55:57 2003 UTC revision 1.32 by jvk, Sat Jul 5 13:13:03 2003 UTC
# Line 88  namespace Geom { Line 88  namespace Geom {
88          /** The distance from the center to the middle of the connection.          /** The distance from the center to the middle of the connection.
89           */           */
90          float d;          float d;
91          /** The thickness of the connection at the middle.          /** The thickness(radius) of the connection at the middle.
92           */           */
93          float t;          float t;
94          /** Whether we're looking at the clockwise (+1) or counterclockwise (-1) side.          /** Whether we're looking at the clockwise (+1) or counterclockwise (-1) side.
# Line 129  namespace Geom { Line 129  namespace Geom {
129                      z(z) {                      z(z) {
130              dir = dirVec(a);              dir = dirVec(a);
131              norm = dir.cw90() * sign;              norm = dir.cw90() * sign;
132              endPoint = node.ctr + d * dir + t/2 * norm;              endPoint = node.ctr + d * dir + t * norm;
133          }          }
134    
135          /** Project a given point to the connecting line.          /** Project a given point to the connecting line.
# Line 189  namespace Geom { Line 189  namespace Geom {
189                  const LinearConnectionHalf &conn,                  const LinearConnectionHalf &conn,
190                  float ta                  float ta
191                  ) : node(node), conn(conn), tangentAngle(ta) {                  ) : node(node), conn(conn), tangentAngle(ta) {
192              r1 = (.5*conn.t - sin(ta) * node.r) / (sin(ta) - 1);              r1 = (conn.t - sin(ta) * node.r) / (sin(ta) - 1);
193    
194              x0 = cos(ta) * node.r;              x0 = cos(ta) * node.r;
195    
# Line 207  namespace Geom { Line 207  namespace Geom {
207          ZVec point(float fract, ZVec *intern = 0) const {          ZVec point(float fract, ZVec *intern = 0) const {
208              float angle = lerp(0, cutangle, fract);              float angle = lerp(0, cutangle, fract);
209    
210              float y = (1-cos(angle)) * r1 + conn.t / 2;              float y = (1-cos(angle)) * r1 + conn.t;
211    
212              float x = x1 - sin(angle) * r1 - x0;              float x = x1 - sin(angle) * r1 - x0;
213    
# Line 344  namespace Geom { Line 344  namespace Geom {
344                  ) : node(node), conn(conn), tangentAngle(ta)                  ) : node(node), conn(conn), tangentAngle(ta)
345                      {                      {
346              eno = Vec(-cos(tangentAngle), sin(tangentAngle));              eno = Vec(-cos(tangentAngle), sin(tangentAngle));
347              ept = Vec(conn.d, -conn.t/2) + node.r * eno;              ept = Vec(conn.d, -conn.t) + node.r * eno;
348    
349              elli = Geom::symmellipse__point_norm(ept, eno);              elli = Geom::symmellipse__point_norm(ept, eno);
350    
# Line 762  namespace Geom { Line 762  namespace Geom {
762          void compute_rtbl(int n) {          void compute_rtbl(int n) {
763              rtbl.resize(n + 1);              rtbl.resize(n + 1);
764                            
765              a0 = atan(0.5 * c.t / c.d);              a0 = atan(c.t / c.d);
766    
767              for (int i = 1; i < n; i++) {              for (int i = 1; i < n; i++) {
768                  float t = i * (1.0 / n);                  float t = i * (1.0 / n);

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26