fritzing-parts icon indicating copy to clipboard operation
fritzing-parts copied to clipboard

core parts need cleaning

Open davidperrenoud opened this issue 10 years ago • 16 comments

From [email protected] on September 09, 2009 15:00:26

There are lots of core parts in need of cleaning.

  1. Many still have sodipodi stuff; sometimes this has been cleaned up, but there are still a dangling attributes left
  2. Every element in a part that will be visible should be inside a element (call this the g-layer-id element). In other words, this element should be either at the top level of the svg, or if there are several layers, next level down. Some parts don't have a g- layer-id-element. Some parts don't have all visible subelements inside the g-layer-id element.
  3. Before a part gets added to the core, one of us needs to check it out.
    Dropping a candidate part into a sketch and exporting it as an svg seems to be a good way to surface problems with a part.
  4. I think we should add new parts to some svn holding pen before they're actually moved into core and released.

Original issue: http://code.google.com/p/fritzing/issues/detail?id=812

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on September 09, 2009 12:08:13

  1. Found some parts with no viewBox attribute, and/or the height and width attributes have no units

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on September 15, 2009 02:47:56

As far as I can tell, Qt gets confused when the width and height attributes of the svg element are "px" (as opposed to "in"). So we also need to edit these parts.

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on November 09, 2009 05:18:16

we need a list and then we can clean em up.

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on November 11, 2009 04:57:43

found "sodipodi":

parts\svg\core\breadboard\atmega168.svg:435 parts\svg\core\breadboard\basic_photo_transistor.svg:399 parts\svg\core\breadboard\basic_relay.svg:399 parts\svg\core\breadboard\ceramic_disk_thermistor.svg:300 parts\svg\core\breadboard\peltier_element.svg:243 parts\svg\core\breadboard\Stepper_Motor_-Bipolar__breadboard.svg:404 parts\svg\core\breadboard\Stepper_Motor-Unipolar__breadboard.svg:404 parts\svg\core\icon\loudspeaker.svg:407 parts\svg\core\icon\microphone.svg:407 parts\svg\core\icon\solenoid.svg:407 parts\svg\core\icon\Stepper_Motor-Bipolar__icon.svg:404 parts\svg\core\icon\Stepper_Motor-Unipolar__icon.svg:404 parts\svg\core\icon\usb_connector.svg:402 parts\svg\core\pcb\pcb-arduino-diecimila.svg:300 parts\svg\core\schematic\atmega168_schematic.svg:411 parts\svg\core\schematic\basic_transistor_npn.svg:300 parts\svg\core\schematic\basic_transistor_pnp.svg:300 parts\svg\core\schematic\capacitor_polar.svg:300 parts\svg\core\schematic\diode.svg:300 parts\svg\core\schematic\lm358_schematic.svg:358 parts\svg\core\schematic\peltier_element.svg:360 parts\svg\core\schematic\power_plug.svg:175 parts\svg\core\schematic\relay.svg:375 parts\svg\core\schematic\spdt-switch.svg:300 parts\svg\core\schematic\Stepper_Motor-Bipolar__schematic.svg:300 parts\svg\core\schematic\Stepper_Motor-Unipolar__schematic.svg:300 parts\svg\core\schematic\thermistor.svg:399 parts\svg\core\schematic\voltage_regulator_5v.svg:300 parts\svg\core\schematic\voltage_regulator_7833.svg:300 parts\svg\core\schematic\voltage_regulator_LM317.svg:300 parts\svg\obsolete\pcb\peltier_sensor.svg:300 parts\svg\obsolete\pcb\Stepper_Motor-Bipolar__pcb.svg:404 parts\svg\obsolete\pcb\Stepper_Motor-_Unipolar__pcb.svg:404 parts\svg\obsolete\pcb\to92.svg:300

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on November 11, 2009 04:58:08

found "inkscape"

parts\svg\core\breadboard\atmega168.svg:506 parts\svg\core\breadboard\basic_photo_transistor.svg:470 parts\svg\core\breadboard\basic_relay.svg:470 parts\svg\core\breadboard\ceramic_disk_thermistor.svg:371 parts\svg\core\breadboard\lm358_bread.svg:94 parts\svg\core\breadboard\peltier_element.svg:331 parts\svg\core\breadboard\Stepper_Motor_-Bipolar__breadboard.svg:94 parts\svg\core\breadboard\Stepper_Motor-Unipolar__breadboard.svg:94 parts\svg\core\icon\loudspeaker.svg:300 parts\svg\core\icon\microphone.svg:300 parts\svg\core\icon\mystery_part_icon.svg:2640 parts\svg\core\icon\solenoid.svg:300 parts\svg\core\icon\Stepper_Motor-Bipolar__icon.svg:94 parts\svg\core\icon\Stepper_Motor-Unipolar__icon.svg:94 parts\svg\core\icon\usb_connector.svg:470 parts\svg\core\pcb\pcb-arduino-diecimila.svg:371 parts\svg\core\schematic\atmega168_schematic.svg:326 parts\svg\core\schematic\basic_transistor_npn.svg:371 parts\svg\core\schematic\basic_transistor_pnp.svg:371 parts\svg\core\schematic\capacitor_polar.svg:371 parts\svg\core\schematic\diode.svg:371 parts\svg\core\schematic\lm358_schematic.svg:94 parts\svg\core\schematic\peltier_element.svg:275 parts\svg\core\schematic\power_plug.svg:281 parts\svg\core\schematic\reed_switch.svg:94 parts\svg\core\schematic\relay.svg:290 parts\svg\core\schematic\spdt-switch.svg:371 parts\svg\core\schematic\Stepper_Motor-Bipolar__schematic.svg:371 parts\svg\core\schematic\Stepper_Motor-Unipolar__schematic.svg:371 parts\svg\core\schematic\thermistor.svg:470 parts\svg\core\schematic\voltage_regulator_5v.svg:371 parts\svg\core\schematic\voltage_regulator_7833.svg:371 parts\svg\core\schematic\voltage_regulator_LM317.svg:371 parts\svg\obsolete\pcb\peltier_sensor.svg:371 parts\svg\obsolete\pcb\Stepper_Motor-Bipolar__pcb.svg:94 parts\svg\obsolete\pcb\Stepper_Motor-_Unipolar__pcb.svg:94 parts\svg\obsolete\pcb\to92.svg:371

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on November 11, 2009 05:16:23

no "viewBox"

parts\svg\core\breadboard\basic_photo_transistor.svg:-1 parts\svg\core\breadboard\basic_resistor.svg:-1 parts\svg\core\icon\555timericon.svg:-1 parts\svg\core\icon\basic-diode.svg:-1 parts\svg\core\icon\basic_fsr.svg:-1 parts\svg\core\icon\basic_pbutton.svg:-1 parts\svg\core\icon\basic_photo_transistoricon.svg:-1 parts\svg\core\icon\basic_relay.svg:-1 parts\svg\core\icon\basic_resistor.svg:-1 parts\svg\core\icon\basic_servo.svg:-1 parts\svg\core\icon\basic_toggle_switch.svg:-1 parts\svg\core\icon\dc_motor.svg:-1 parts\svg\core\icon\lm358icon.svg:-1 parts\svg\core\icon\optocoupler4n35_icon.svg:-1 parts\svg\core\icon\plain_pcb.svg:-1 parts\svg\core\icon\potentiometer.svg:-1 parts\svg\core\icon\Stepper_Motor_-Bipolar__icon.svg:-1 parts\svg\core\icon\Stepper_Motor-Unipolar__icon.svg:-1 parts\svg\core\schematic\555timerschematic.svg:-1 parts\svg\core\schematic\basic_fsr.svg:-1 parts\svg\core\schematic\basic_transistor_npn.svg:-1 parts\svg\core\schematic\basic_transistor_pnp.svg:-1 parts\svg\core\schematic\capacitor.svg:-1 parts\svg\core\schematic\capacitor_polar.svg:-1 parts\svg\core\schematic\diode.svg:-1 parts\svg\core\schematic\fet_n.svg:-1 parts\svg\core\schematic\fet_p.svg:-1 parts\svg\core\schematic\ldr.svg:-1 parts\svg\core\schematic\led.svg:-1 parts\svg\core\schematic\lm358_schematic.svg:-1 parts\svg\core\schematic\optocoupler4n35_schematic.svg:-1 parts\svg\core\schematic\pushbutton4lead.svg:-1 parts\svg\core\schematic\reed_switch.svg:-1 parts\svg\core\schematic\resistor.svg:-1 parts\svg\core\schematic\servo_schematic.svg:-1 parts\svg\core\schematic\spdt-switch.svg:-1 parts\svg\core\schematic\Stepper_Motor-Bipolar__schematic.svg:-1 parts\svg\core\schematic\Stepper_Motor-Unipolar__schematic.svg:-1 parts\svg\obsolete\pcb\LED-red-5mmpcb.svg:-1 parts\svg\obsolete\pcb\peltier_sensor.svg:-1 parts\svg\obsolete\pcb\Stepper_Motor-Bipolar__pcb.svg:-1 parts\svg\obsolete\pcb\Stepper_Motor-_Unipolar__pcb.svg:-1

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on June 30, 2010 13:58:51

Owner: irascibl
Cc: -andre.knoerig -lionel.michel -irascibl -merunga

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on September 27, 2010 13:55:11

Labels: Component-Parts

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on July 11, 2011 02:51:24

I'm trying to make a checklist so that I can write a parser that will automatically detect SVG problems. Please help me with any other issues you remember.

  1. illustrator non-standard px (or missing) units
  2. svgs missing the viewbox attribute
  3. simple linear and radial gradients are now ok, gradient refs (using xlink syntax back to "defs") are not
  4. xlinks don't work
  5. svg height and width values with no units
  6. svgs that say both "illustrator" and "inkscape" (or "sodipodi")
  7. connector references not contained within a recognized layer

this is ok: ... <circle id="connectorXpin" ...> ...

this is not ok: <circle ... id="connectorXpin" .../> ....

  1. text using elements (this is not allowed in tiny 1.2). Fritzing code does check for this condition, but a few cases may still be slipping through the cracks.
  2. internal coordinates with units (all coordinates are supposed to be relative to the viewBox, so units are not necessary)
  3. All the crap that comes with inkscape. Inkscape images should be saved as "plain svg". The only known bug here I can barely remember, but it had to do with inkscape caching extra versions of some coordinates for certain svg elements, and Fritzing finding the wrong set.
  4. We have gotten a lot better about dealing with transforms, but still, the fewer the better. We are also better at dealing with internal transforms (where the transform is an attribute inside a , , , ... element) but problems are still sometimes turning up, so try to avoid this formulation.
  5. Transforms applied outside the intended SVG layer are not currently recognized (we should fix this at some point). For example, this won't work:

<svg ...>

  1. Fzp files that specify a connector, but that connector isn't identified in the corresponding SVG.
  2. Font references other than droid or ocra 10. I think we check images being imported to the parts editor for this, but assume our own images are correct.

Cc: [email protected] [email protected] [email protected]

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on July 11, 2011 08:56:48

Here's more detail about inkscape crap. This is a typical inkscape element:

Notice that there are both sodipodi:cx and cx. Well sometimes they are not the same, and if Fritzing is just parsing for "cx" it's not clear which one will come up first.

Plus it makes all the files about twice as large.

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on August 28, 2011 14:51:25

Owner: [email protected]
Cc: [email protected]

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on September 22, 2012 01:14:58

I now have a pretty good chunk of svg cleaning code running internally in Fritzing, but it involves repeated parsing of each svg when it is loaded. It would be nice to run this over all the svgs in the core in a one-time operation, replacing the affected core files, so that at load time we could skip running the cleaning code for core parts.

Cc: [email protected] [email protected]

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on October 22, 2012 20:46:32

Owner: [email protected]
Cc: [email protected] [email protected]
Labels: -Type-Defect Type-Enhancement

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

From [email protected] on January 20, 2014 06:46:29

Since there is already a lot of fix-up svg code in Fritzing, could add this as part of the -db command-line option. Load each svg, run the cleanup code, and save the svg back out again.

Cc: [email protected] [email protected] [email protected]

davidperrenoud avatar Aug 25 '14 19:08 davidperrenoud

Move to the part repository?

failiz avatar Oct 28 '20 22:10 failiz

Ping

failiz avatar Mar 20 '21 16:03 failiz