Jump to content
You must now use your email address to sign in [click for more info] ×

JohannesMP

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by JohannesMP

  1. I believe I've Identified the core bug causing this problem: Cricut Design Space's SVG importer incorrectly parses transformation matrix attributes TL;DR In an SVG basic shapes (rectangles, ellipses, etc) will often require an additional transformation, represented as a matrix. When importing an SVG file Cricut Design Space reads two of the elements of a matrix out of order. If these two elements are not equivalent, then the shape will appear incorrectly transformed in Cricut Design Space. Specifically when 'uploading' an SVG file containing transform attributes of the format: transform="matrix(A, B, C, D, E, F)" Cricut Design Space will incorrectly parse the attribute as: transform="matrix(A, C, B, D, E, F)" Where the 2nd and 3rd element of the matrix are read in as swapped, resulting in incorrect transformation behavior when these values are not equivalent. Example 1 Wonky.svg - Exported from Adobe Illustrator. Showing file below, and also included as attachment <?xml version="1.0" encoding="utf-8"?> <!-- Generator: Adobe Illustrator 27.9.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 500 500" enable-background="new 0 0 500 500" xml:space="preserve"> <polygon fill="#231F20" points="142.9,261.6 125.6,278.8 140.5,321 98.3,306.1 81.5,323 149.3,347.1 174.6,419.8 191.9,402.9 175.4,355.9 222.4,372.4 239.7,355.1 166.6,330.2 "/> <rect x="204.6" y="216.6" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -137.6367 235.4805)" fill="#231F20" width="21.7" height="134.5"/> <polygon fill="#231F20" points="244.5,160 305.1,221 209.6,194.9 194.7,209.8 289.9,304.9 304.7,289.7 240.5,225.4 341.3,253.5 354.5,240.3 259.4,145.1 "/> <path fill="#231F20" d="M392.3,116.6l-4-4l-31.7,31.7l16.1,16.1l14.5-14.5c10,13.3,10.8,24.1,2.4,32.9c-6.8,6.4-14.5,8.4-24.1,5.2 c-9.2-3.2-18.9-10-29.3-20.1s-16.9-19.7-20.1-29.3c-3.2-9.2-1.6-17.3,5.2-24.1c7.2-6.8,15.7-8.8,25.3-5.2l7.2-20.9 c-17.7-6-33.3-2.4-47.4,11.2c-11.2,11.2-15.3,24.1-12.9,38.6c2.4,14.5,11.6,29.7,27.3,45.4s30.5,24.5,45.4,27.3 c14.5,2.4,27.7-1.6,39.4-13.3c9.6-9.6,13.7-21.3,12-34.5C415.2,145.5,406.7,131.5,392.3,116.6z"/> </svg> Adobe's SVG exporter will attempt to use the SVG tag best suited for each shape. I assume the same is likely true for Affinity. The 'G' has curves and so is represented as a 'path' The 'X' and 'N' shapes have no curves and so can be represented as 'polygon' The 'I' can be represented as a 'rect', and that requires a transformation matrix to be rotated and positioned correctly (since transformations are applied relative to the parent of the current shape, which in this case is the origin in the top-left). When an SVG containing such a rect is uploaded into Cricut Design Space the rectangle will appear incorrectly positioned. Try it for yourself: Download the attached Wonky.svg, open it in a text editor, locate the rect tag on line 7, and swap the 2nd and 3rd number of the matrix (basically just moving the negative sign in this case) and save the file. The file will now open correctly in Design Space, and will appear broken everywhere else. I believe that this bug is rarely encountered because this would generally only apply to basic shapes such as rect or circle—ones that require an additional transform to be positioned/rotated/skewed/etc. correctly—and even then only when the 2nd and 3rd element of their matrix are not equivalent. Example 2 Matrix_Demo.svg - manually authored SVG based on this example, see attached file. This SVG contains two rows of grouped rectangles with matrix transforms applied. The bottom row is identical to the top, except that the 2nd and 3rd element of the transformation matrix of each rect have been swapped. Note how Cricut Design Space's preview appears to have the top and bottom row swapped when compared to how the SVG is rendered both in the browser as well as in Adobe Illustrator. This demonstrates how swapping the 2nd and 3rd elements of the matrices reproduces the behavior observed in Cricut Design Space. To fix If you open the SVG file in a text editor and CTRL+F for "matrix", you know you're fine if there are no matches. If the file does contain a matrix: Either manually swap the 2nd and 3rd element of each matrix in the SVG file before opening it in Cricut Design Space Note that once edited the SVG will appear correct in Cricut Design Space, but any other program will now display the transformation wrong. Or before saving the SVG you can perform any one of a number of operations that 'flattens' the simple shapes to more general paths/polygons that won't require a transformation matrix once saved as an SVG This is why adding a node to the path, or 'flatten transforms' works. I have reported this bug to Cricut through their suggestions/bug form. If anyone else wishes to help then poking them with a link to this post may help expedite a fix. Matrix_Demo.svg Wonky.svg
  2. Just my two cents, but I found it more comfortable to change the scroll wheel to zooming (Preference->Tools->Use mouse wheel when zooming), and just always use space+LMB to pan. That way I don't have to rely on the interactive zoom tool. I can see why that wouldn't work though if you need very accurate zooming, but just in general workflow.
  3. Coming from Photoshop, I'm used to being able to create guides as I need them by clicking and dragging from the rulers onto the canvas, regardless of what tool I have selected at the time: Creating guides while using the pen tool is quite useful. Trying to learn Affinity Designer now, I've noticed that this is not always possible; Creating guides by dragging from the rulers is only possible when using the move tool: This means that it is not possible to place guides to help you align nodes while in the middle of drawing a shape with the pen tool. You have to switch back to the move tool instead. Since, as far as I can tell, there would be no contention with other UI interactions (dragging from the rulers to the canvas when not using the move tool never seems to do anything), I feel that the same behavior observed in Photoshop should be implemented in Affinity Designer. It would really help streamline things for designers that use guides as part of their workflow.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.