Well it would be right what you say here, just that the info is
sometimes coming for now directly form "table.create_primitive", which
creates a Primitive instance for primitives which don't yet have a
python wrapper.

Till recently the name was coming in that case from the
MAGIC_TO_PRIMITIVE_TYPE map, and I'm abusing it now with the
rt_xyz_internal structure, again only for those primitives which are not
yet wrapped properly. That allows me to play around with the BRL-CAD
internal data which is exposed that way.

I will fix this to use the class name for all other than Primitive, and
add another (optional) parameter to the Primitive class to expose the
BRL-CAD internal data. It is in fact useful to see what kind of
primitive it is when printing it out, even without having a proper
wrapper... when only using the class name, those would all print a
generic "Primitive".

Anyway, you're right it's not implemented properly, and I will fix that.

Cheers,
Csaba


On Mo, 2014-02-17 at 13:24 -0800, Bryan Bishop wrote:
> In brlcad/primitives/arbn.py:
> 
> > @@ -0,0 +1,28 @@
> > +"""
> > +Python wrapper for the ARBN primitive of BRL-CAD.
> > +"""
> > +
> > +from base import Primitive
> > +from brlcad.vmath import Plane
> > +
> > +
> > +class ARBN(Primitive):
> > +
> > +    def __init__(self, name, planes, copy=False):
> > +        Primitive.__init__(self, name=name, primitive_type="ARBN")
> 
> primitive_type seems redundant, since the class.__name__ value is
> already set to "ARBN". Couldn't it just check the class name instead
> of passing a constant?
> 
> —
> Reply to this email directly or view it on GitHub.
>