I made PHP viewer for fritzing but


Hello, i made a Fritzing.class.php file in order to have a viewer for a fzz in svg format.
Everything work like a charm but i’ve some problem with rotations of components.

Instances rotations seem to be defined in the attributes of
node but the format of it is a mystery for me, i see 9 parameters like
m11="0.707107" m12="0.707107" m13="0" m21="-0.707107" m22="0.707107" m23="0" m31="15.9403" m32="-2.45825" m33="1"
for a simple 45° rotation, so far I have deduced by myself the logic of xml but on this data format, i’m lost …
Any ideas ?


I would create a new fritzing sketch and only put one part on the board and set its location to 0, 0 in the inspector and do not rotate it. Then save the sketch and open it in your editor and take note of the numbers. Then I would open the sketch again and turn the part once (45 degrees), save and re-check in the editor and take note of the numbers again. After that I would try moving the part a specified amount using the inspector and again after saving check it in your editor. You should be able to tell what changes take place for each type of move.


While I’d probably try Sublimeartistry’s suggestion first, if you want the technical explaination you are looking for transform matrixes in the svg spec. I think that the various editors use different ones and I don’t know what Fritzing does (which is why trying it on Fritzing output is the best bet.)



Thanks for your responses.

I’v already tried this manipulation, for 0 0 0 (x,y,r) i’ve a geometry with
<geometry z="2.5" x="-0.3095" y="0.4595"/>
And no transform subnode (because no rotation)

with a rotation of 45° a transform node appear with
<transform m11="0.707107" m12="0.707107" m13="0" m21="-0.707107" m22="0.707107" m23="0" m31="8.74625" m32="-12.3763" m33="1"/>

It seem position (geometry attirbute) and rotation (transform attributes) are not linked, and position work well in my wiewer, that’s just the transform attributes which are incomprehensible for me, if it’s a transformation matrix there should be only 6 parameters and not 9 ?


I thought i’m understanding something.
math matrix is actually composed of 9 parameters but only 6 are useful in our case :

It seem that m13,m23 and m33 are thoses useless 3 coordinate, i’ll try to transpose other m11,m12,m21,m22,m31,m32 to the 6 parameter of svg matrix.


It works ! I’ve probably the first web fritzing projet viewer, thanks for your emulation ! :slight_smile: