Lbrn2 File Format Questions - origin point?

Hey all! I’ve already found a few example posts to edit to lbrn2 file - but had a question or two about setting the origin for an image.

I understand the last two xform values (eg -6.0250498e-09 -0.036981501 0.036981601 -6.02506e-09 0 184.968 - 0 & 184) are the X/Y translations respectively. I have a script that can walk through the various xforms for a given shape modifying those values. The issue is that setting both the X/Y translation to zero doesn’t zero the actual shape’s position on the Y:

This is with all xform Y translates set to 0 - the offset is still -50.452. Any help would be appreciated - longer term I want to import images & reset their current postions so I can offset them from some known previous position (think like checkerboarding a lot of images across a sheet).

I have no idea what you are talking about, but this statement suggests you check your G54 values.

He is referring to the LBRN2 code. It has nothing to do with Gcode.

You mean the XML code of the saved file? That would make the 50mm offset being introduced by his procedure in my opinion.

Obviously I do not have good grasp of how he is doing whatever he is trying to accomplish. :nerd_face:

1 Like

Apologies - yes this is related to the LBRN2 code. More details on what I am attempting to do:

  • I have an LBRN2 file that has 100s of shapes within in, all sitting at random-ish points
  • I want to write a python script that takes in this file - and for each shape/design within it - modifies it’s origin point - ie shape 0 at X0/Y0, shape 2 at X10, Y0, shape 3 at X20, Y10, etc
  • Re-write the LBRN2 file (really, xml) such each shape now has a unique & orderly origin

I thought it would be as easy as modifying the top level xform translation value of each shape, but that seems to be wrong - every shape did update it’s position (translated) but to seemingly random locations.

I then tried updating the translation of a single shape - every xform - and I got the above when setting the values to 0/0 which I thought would set it at the true origin. My initial thought is there seems to be some initial offset like you’ve stated @MikeyH - but I cannot for the life of me figure out where that might be either within a given shape or the entirety of the file.

I am up to speed now.

Did you examine the XML entries for the shapes that do not play well with others. There might be an element in there not in, or different from, the ones that do cooperate.

If you break apart all of your shapes, and then autojoin them, that “zeros” each shape out. I am by no means an expert on LBRN2, but know that is easier to write LBRN code (the older code verses LBRN2)

@MikeyH - For the very basic example above there was nothing out of the ordinary that I could see causing this additional translation from the origin (Again - the above is with 0 x/y translation & identity rotation matrix values in the ‘Group’ shape xform & all child shape xform’s, I’ve tried some combinations of both + deleting various sub-shapes to no avail)

@RalphU - that makes sense, it’s highly likely whoever was working on this project previous was messing with layering/breaking up designs etc in an unconventional way. I was trying to get away from manually having to modify each design, especially since they’re all stacked in one file. Seems like I might just need to do this manually due to my limited understanding of the file formatting vs GUI in LB.

Thanks for the suggestions though - I will be here manually editing/translating if you have any more :slightly_smiling_face:

1 Like