It looks like you're new here. If you want to get involved, click one of these buttons!
when I have an array of shapes and ask shapes[i].is_polygon? or any of the other .is_???, I usually get true or false.
However, when I pass the array of shapes through a ShapeProcessor, the resultshapes[i].class.to_s still says RBA::Polygon, but resultshapes[i].is_polygon? hangs up the code. Getting the ShapeProcessor to merge already required a strange shape re-collecting. Below is the merge function with the shape processor in it. Do you have a better suggestion on how to implement this ? s1 are shapes of 1 layer, and I would like to merge them no matter what they are (except text of course). The code also worked the same way without the Polygon::new re-assembly after merge. After that, I pass it on to other functions that call .is_xxx? and that is where it sours. If exlude this mergeShapes(s1) function, everything runs fine.
I know this isn't a lot of information go by, but if you have a suggestion that would help me already.
Thank you !
def mergeShapes(s1) retVal =  if s1.size>0 shapes =  s1.each do |shape| shapes << shape end ep = RBA::ShapeProcessor::new begin newshapes = ep.merge_to_polygon(shapes, 0, true, true) newshapes.each do |newshape| retVal << RBA::Polygon::new(newshape) end rescue => ex puts "MERGE FAILED: " + ex.to_s retVal = s1 end else retVal = s1 end return retVal end