jepler_: around? got a python question
I'd like to extend vismach - I want to have a self.volume value for each primitive - I know how to add it to Box, Cylinder, etc
but the next step is to add it to class Collection, such that the volume of the collection = the sum of its parts
actually, I don't know how to add it to the primitives
I was gonna stick the computation in __init, but they don't have an init - all the calcs are done in the draw method
jmkasunich: hm, you could make volume a method -- def volume(self): return ...
then in collection, it can do a sum of the volume of the contents
I just wrote the volume method for Box
I haven't figured out yet how to iterate over all the things in a collection
return sum(part.volume for part in parts)
I think it'll look something like that: ^^
now one more thing
I see that Color is a class
I think of color as being an attribute of a collection, not an object in itself
a Color is a kind of Collection that applies the color to the things it contains
Color will need to have a volume method, right?
no, it will get the one from Collection
return sum(part.volume() for part in self.parts)
almost what you gave me
() after the recursive call, and self.parts, not parts
* jmkasunich is making poor man's proE
should say, programmer's pro-E
there's no GUI, you have to write python to describe your part(s)
jepler_ is now known as jepler
it doesn't make much sense to add functions (methods) together :-P
you warned me that it would be "something like that"
OK, now write the "center of gravity" and "moment of inertia" functions :-P
I'm still doing volume of a cylinder
(since our cylinder primitive actually can do a frustum of a cone)
I love the word "frustum"
google corrected my misspelling "frustrum"
I like that word too
is it a word?
no, probably not
this OO stuff is kinda cool
there are lots of objects that aren't really objects
hm you sound a little bipolar
what's biting you now?
"Capture" is a collection
(used for tracking the toolpath)
it had no volume method, so it barfed - I just gave it one that returns zero
maybe you need to 'def volume(self): return 0' in it
but I see you figured that out first
now I'm trying to find out why one of my cylinders has zero volume
hmm, is there a way to print the name of a class instance
foo = Box(blah)
bar = Box(blah)
baz = Collection([foo,bar)
you can 'print' almost any object
it'll say something cryptic like <__main__.X instance at 0x7f4914aef4d0>
when I invoke baz.volume, it recurses down thru foo and bar
I'm printing in Box.volume
oh, the name like 'bar'? no
but I can't tell which line corresponds....
if I was really trying to make this thing more CADish, I guess I'd add a name to each instance
huh -- why would you define the address lines of your SRAM interface to be 'SLOW' slew rate, and the data lines to be 'FAST'?
(fpga with external SRAM)
are there lots of external ram chips?
(loading issue with fast transitions?)
I think it's 2 1Mx16 SRAMs organized as 1Mx32
er, 256Kx (1MB total)
64K x 16 = 1Mb
oh, big B
I'm having a bit of trouble wrapping my head around the "coords" method
in particular, HalToolCylinder
I have a non-zero tool radius and length, and it is being drawn correctly, but when I invoke volume, it assumes zero radius
oh, never mind
I'm invoking volume during startup, before the hal pin that provides the radius is connected
that makes sense
yep - invoked it on return from main and got a non-zero answer
hmm, there are limits to this technique
if you construct a union of objects, the overlapping volume gets counted twice
What do you guys make of this compile time warning.
hal/classicladder/socket_modbus_master.c:257: warning: the address of ‘ClientSocketOpened’ will always evaluate as ‘true’
ClientSocketOpened is a function, but it's used where a boolean value is normally expected -- if ( ClientSocketOpened )
maybe the intent was to call the function and look at the return value
if ( ClientSocketOpened() )
indentation is all fscked up right there
I wouldn't feel too bad about just adding the () and committing it, but if you want to be really safe email Chris Morley
the indentation should be fixed too, but not in the same commit
I can email Chris if you want with a copy of this.
I'll leave it to you
Got another one.
I'm about 99.99% sure the () will fix it
k -- lost the second one. it was emcrsh
might have to touch the file - if it compiled once, make won't compile it again
emc/usr_intf/emclcd.cc:399: warning: comparison with string literal results in unspecified behaviour
I bet he wanted to compare to NULL, but that one is less clear to me - it should be brought to Eric's attention
k I'll do that as well.
both of those lines are testing for conditions which are rare, but could cause a crash if not detected
thanks for catching them
np. was testing a bit of stuff of my own when they went by.
EMC: 03jmkasunich 07TRUNK * 10emc2/lib/python/vismach.py: added computation of the volume of each primitive - for crude solid modeling work
EMC: 03rayh 07TRUNK * 10emc2/src/emc/nml_intf/canon.hh: Added ifndefs for cleaner product of java script.
EMC: 03rayh 07TRUNK * 10emc2/src/emc/rs274ngc/rs274ngc.hh: Added ifndefs for cleaner product of java script.
EMC: 03cmorley 07TRUNK * 10emc2/src/hal/classicladder/socket_modbus_master.c: Fix compiler complaint- removed code to check a variable that was always true and unnessasary
EMC: 03cmorley 07TRUNK * 10emc2/src/hal/classicladder/protocol_modbus_master.c: Change messages for consistency
fenn_ is now known as fenn
Why do I get empty files named something like grohtml-###.png in docs/man?
And why don't they go away with a make clean?
grohtml is the thing that converts the manpages into html. Those files should presumably be added to the 'docclean' rule in doc/src/Submakefile.
Ah. That's why I get a new one each time I make.
EMC: 03rayh 07TRUNK * 10emc2/docs/src/Submakefile: add empty png files to make clean.
EMC: 03lerman 07TRUNK * 10emc2/src/emc/rs274ngc/ (4 files): Add support for wizard directory. Fix a bug in O_word elseif.
EMC: 03seb 07TRUNK * 10emc2/src/hal/drivers/mesa-hostmot2/ (hm2_7i43.c hostmot2-lowlevel.h): minor cleanups
EMC: 03seb 07TRUNK * 10emc2/src/hal/drivers/mesa-hostmot2/TODO: once more i think i know what i'm going to do about firmware loading
EMC: 03seb 07TRUNK * 10emc2/src/hal/drivers/mesa-hostmot2/doc/firmware-loading-debacle: once more i think i know what i'm going to do about firmware loading
lol at seb
[20:53:20] <jmkasunich> http://cvs.linuxcnc.org/cvs/emc2/src/hal/drivers/mesa-hostmot2/doc/firmware-loading-debacle?rev=1.1