-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving parts #386
Comments
The subset of the svg standard used for Fritzing might have problems, but the full standard supports animations. All that should be needed is a method to 'freeze' an animation at a specific timepoint. |
I tried this in a browser, and i think the "freeze" was one of the things i had trouble with. There are a number of javascript libraries that modify the DOM of the SVG for animations. From the C++ implementation side, i think it doesn't matter much, we need to code the effects anyway. For many things, like brightness of a LED, we could in theory use CSS, which is also part of the SVG standard. However, i am afraid that this would bring in huge complexity: CSS itself is way more complex than SVG, and I doubt we can get away with supporting only the tiny element that we need. (we don't want it to mess with pcb footprints) |
I did not think it would be that complicated. I have not researched extensively, but a quick question to ChatGPT says that QT has the support needed for SVG animations. Previous exploration has found that the code supplied by ChatGPT can be wrong, but it usually gets the basics right. This is likely based on 'full' SVG, not the subset that Fritzing currently uses. For 'settings' type cases, I would expect the details to come from inspector. Instead of extending svg to store data like that, I would lean towards putting it in the fzp file, leaving only an id (and graphics) in the svg to link it to.
|
Since we have a simulator in Fritzing, we are trying to improve the support for dynamic SVGs. For example, we might have a knob on a potentiometer that can be turned, or rotate the lever on a servo.
Right now this would be a quite complex custom implementation for each of these examples.
But ideally, we'd have support for that in the part format.
One idea is to use data-* attributes, that Fritzing would then apply:
Other attributes could change the visibility , color or move an element along a path.
Support for official animated SVG is limited (also in modern browser), so we could use a custom solution. If there is a widespread and dependency free javascript library, we could use that SVG syntax. In the end it will probably not be possible to stay compatible with any library, so it would be just about evaluating the syntax. Of course compatibility would be interesting if we can get better support from designer tools this way, but I don't know any such library.
The text was updated successfully, but these errors were encountered: