How to make an app

To be honest, I’m not exactly sure ! “somehow”, that rect statement is stopping the import from happening ( with no error message), or the import happens successfully, but the rect “covers” everything else. Maybe try putting it back in and change Z-Order ( I assume you can do that with an SVG ) ?

I tried your code with both the rect as you wrote it, and a rect with no fill or stroke. Neither worked. But it did when I removed the rect statement. Needs some more playing with to see the real issue, and I’m not fully confident on what the actual issue is !

Ok, I will going on playing with it.

Thanks a lot for your effort!

Hi @WolfgangEgger,

It looks like the problems with your SVG above are strictly syntax-related. I did 2 things and was able to import the SVG into Easel:

  1. Removed spaces after < characters that marked opening tags, such as < circle>
  2. Removed trailing space in the style attribute of the <rect> element

Easel could probably handle that 2nd issue better, but the first issue yields an invalid SVG file.

Cheers,
Jeff

Servus @JeffTalbot,

aehm no, I included this spaces after < characters only, to make it possible to display the svg-string here in the forum :wink:

My code didn’t produce this spaces.
But I will look at the second issue, because easel couldn’t handle the rect. After replacing the rect with a path, everything works fine …

Is there a code example, how to read in text-files?
I want to read in gerber-files, to convert them to SVG with a lib.

The second thing, I have to do then, would be to produce contours around the lines, that are produced by the lib, because easel sees them as lines and not as areas.
is there any other way to let easel carve around a line?

At the top of this thread is an example of how to have a file type for input.,

{id: “Your file”, type: “file-input”},

I would imagine that the Params would then just return a long string containing the file that you can parse. I would make a quick example, and then send out the value of that field to the log.

Yes, that was the same, what I have imagined and done, but the result of that log was:
https://www.filepicker.io/api/file/FBShDk4lSdC761KWYJUY?policy=eyJleHBpcnkiOjE0NDQ3OTg4MDAsImNhbGwiOlsicmVhZCIsImNvbnZlcnQiXX0%3D&signature=46f4e5bedf66a15532733c8998dcf9c5134589981c20d814b84a83c73dd21455

So this is not the content of “Your file” and I think, there is something more to do.

Ok. You can click the “</>” icon in the text editor to embed tags in a post.

Yeah. Like I said, changing both of those things allowed me to import the SVG into Easel successfully.

If you have a file-input property, Easel will pass you a URL to the file. You have to read from that URL to open the file. There is a known issue in Easel right now where if the user has had the app loaded for a while then the signatures on the URLs can time out. We’ll be fixing that behind the scenes so that the URLs you are given will always work.

Cheers,
Jeff

Tanks a lot, that works fine.

Is it possible to add formatting to the description field ? newlines etc ?

Hey Andy, not at the moment. Descriptions are stored as plain text and rendered inside of a p tag. I think it would be neat to let devs render their own html or markdown in the description. I’ll discuss it with the rest of the team.

1 Like

It would also be handy to be able to have tooltips for the adjustable paremeters, either by hovering over, or a little “?” button. Since touch screens are an option a button might be better. It can be a little hard conveying the function of a parameter just in the name.

1 Like

any idea when this is going to happen?

i am trying out some stuff and finally got the size figured out (using the width, height and viewBox attributes of the svg tag). now i can make a line (with rounded ends) or hole: but if i make the line width or hole the size of the mill (say 1/8") easel still complains it is too small. how much larger does the minimum width need to be?

i tried some values: seems a circle with with a radius of 1.005x that of the mill will work (1.0025x not)

This is a well known “feature” of Easel based on how it generates paths, it can’t cut a path the same size as the bit. As you found, you can either tweak the hole size or the bit size slightly.

If you add a param like so:

 {id: "Use MM", type: "boolean", value: false},

you can use the following code to setup the viewbox for inches or mm

  var useMM="in";
  
  if (params["Use MM"] === true)
  {
   useMM="mm";
        
  }

'<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="'+width+useMM+'" height="' +height+useMM+'" viewBox="0 0 '+width+' '+height+'">',

This then lets the user use either mm or inch for their dimensions and the viewbox is scaled to suit

i figured out the absolute sizing. that works fine. thanks

i like to cut out an object (but need to use “fill”) and although the factor is only 1.005x i still see the router do 2 passes (per depth). no tricks to have it do in a single pass?

Someone posted a couple of weeks ago a trick using the inlay app to make it generate one pass.

Who’s the best person to contact with regard to getting an app reviewed and possibly approved ?