1 |
/* |
/* |
2 |
Trivial.hxx |
Trivial.hxx |
3 |
* |
* |
4 |
* Copyright (c) 2003, Tuomas J. Lukka |
* Copyright (c) 2003, Tuomas J. Lukka and Janne V. Kujala |
5 |
* This file is part of LibVob. |
* This file is part of LibVob. |
6 |
* |
* |
7 |
* LibVob is free software; you can redistribute it and/or modify it under |
* LibVob is free software; you can redistribute it and/or modify it under |
21 |
* |
* |
22 |
*/ |
*/ |
23 |
/* |
/* |
24 |
* Written by Tuomas J. Lukka |
* Written by Tuomas J. Lukka and Janne V. Kujala |
25 |
*/ |
*/ |
26 |
|
|
27 |
#ifndef VOB_VOBS_FILLET |
#ifndef VOB_VOBS_FILLET |
134 |
} |
} |
135 |
|
|
136 |
template<class T> float crad(const T &t) const { |
template<class T> float crad(const T &t) const { |
137 |
return t.getSqSize().x; |
return 0.5 * t.getSqSize().x; |
138 |
} |
} |
139 |
|
|
140 |
struct Conn { |
struct Conn { |
141 |
template<class T> float crad(const T &t) const { |
template<class T> float crad(const T &t) const { |
142 |
return t.getSqSize().x; |
return 0.5 * t.getSqSize().x; |
143 |
} |
} |
144 |
float th; |
float th; |
145 |
float a; |
float a; |
297 |
const Transform &t1 = *t[3]; |
const Transform &t1 = *t[3]; |
298 |
const Transform &t2 = *t[4]; |
const Transform &t2 = *t[4]; |
299 |
|
|
300 |
ZVec p0 = t0.transform(t0.getSqSize()); |
ZVec p0 = t0.transform(0.5 * t0.getSqSize()); |
301 |
ZVec p1 = t1.transform(t1.getSqSize()) ; |
ZVec p1 = t1.transform(0.5 * t1.getSqSize()) ; |
302 |
ZVec p2 = t2.transform(t2.getSqSize()) ; |
ZVec p2 = t2.transform(0.5 * t2.getSqSize()) ; |
303 |
|
|
304 |
ZVec ctr = p0; |
ZVec ctr = p0; |
305 |
Vec v1 = p1 - ctr; |
Vec v1 = p1 - ctr; |
523 |
} |
} |
524 |
|
|
525 |
template<class T> float crad(const T &t) const { |
template<class T> float crad(const T &t) const { |
526 |
return t.getSqSize().x; |
return 0.5 * t.getSqSize().x; |
527 |
} |
} |
528 |
|
|
529 |
ZVec norm(ZVec v) const { |
ZVec norm(ZVec v) const { |
539 |
const Transform &t0 = *t[2]; |
const Transform &t0 = *t[2]; |
540 |
const Transform &t1 = *t[3]; |
const Transform &t1 = *t[3]; |
541 |
|
|
542 |
ZVec p0 = t0.transform(t0.getSqSize()); |
ZVec p0 = t0.transform(0.5 * t0.getSqSize()); |
543 |
ZVec p1 = t1.transform(t1.getSqSize()); |
ZVec p1 = t1.transform(0.5 * t1.getSqSize()); |
544 |
|
|
545 |
float d = (p1 - p0).length() / 2; |
float d = (p1 - p0).length() / 2; |
546 |
float r = crad(t0); |
float r = crad(t0); |