On Apr 7, 2013, at 6:57 AM, Csaba Nagy wrote:
> I refactored it again, and it turned out to be just code move-around, no
> new structures needed. But now I like the result, so I uploaded the
> patch:
That'll make the patch a lot easier to review anyways, so sounds good. Thanks!
> Well I interpret that differently: the list of linear/bent pipe elements
> _is_ the specific structure for the pipe, so I don't see any problem
> there.
It certainly is being used as the specific, so sure perhaps an interpretation
of perspective, but it's unlike the rest in significant ways. The point was
more just to assure that there's room for change there if you needed some
fields and not others. For example, the "essential" ones could have been at
the top of the structure along with a pointer to the current structure. If the
pointer is NULL, it would know that portion was unused/uninitialized.
> I shortly tested my refactoring patch against this pipe:
>
> db put tp1.s pipe V0 { 0 -6 0 } O0 2 I0 0 R0 4 V1 { 0 -4 4 } O1 1 I1 0
> R1 4 V2 { 0 4 4 } O2 2 I2 0 R2 4 V3 { 0 4 12 } O3 1 I3 0 R3 4 V4 { 0 10
> 12 } O4 2 I4 0 R4 4
That's actually a nifty example shape.
> * how is the voulme/surface defined for those ? Does the inner surface
> also count ?
Having a non-zero inner diameter creates a void, so yes it should be reflected
in the volume and surface area calculations.
> * For volume, do I subtract the inner holes ? What about a pipe which
> has inner holes only in some inner segments, see this one:
>
> db put tp2.s pipe V0 { 0 0 0 } O0 2 I0 0 R0 2 V1 { 0 0 4 } O1 2 I1 1 R1
> 2 V2 { 0 4 4 } O2 2 I2 0 R2 2
>
> If you render it, will show like a closed pipe - but the inner segment
> should have a hole in it...
It'll probably be easiest to do the volume and SA calculations piecewise for
each defined segment. That way should make it pretty easy to keep track of any
interior radius to subtract from the volume or add to the surface area. Inner
diameter jumps will be a pain, but the calculations should be trivial (e.g.,
linear segments are just a cylinder or cone shape) for all except a bend with
an inner diameter change (a pinched torus, ugh). Hm, do we even allow that?
Maybe not even an issue.
> BTW, "E tp2.s" will cause a "Bad pointer" error and crash mged ;-) (with
> or without my refactoring patch). And on further testing, tp1.s will do
> that too...
Confirmed here too, thanks.
Cheers!
Sean
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel