Monday, 16 January 2017

My first SVG

SVG stands for Scalable Vector Graphics. It's a pretty common type of image.

Why?

For my project (recreation of an MPG-80), I need to cut a sheet of metal. Because the cut has to be precise, I choosed to use a laser cutting service. To do so, I need to produce a file (SVG) which represents the path of the laser beam.

My first idea was to vectorize with Inkscape the file I created with Gimp:

Gimp -> PNG file -> Inkscape -> SVG file -> FreeCAD

The result was poor, because the vectorization process created a lot of path (above 2000, whereas I have only 140 objects).

I definitely needed a more precise process. The idea was to create the SVG from scratch:
1- precisely measuring the coordinates of all the objects (holes)
2- creating a SVG file from scratch with Inkscape
3- importing the file in FreeCAD

Fortunately, all the objects I need to cut  boxes, circles and paths (shapes bazed on Bezier curves) and all are symmetrical around vertical and horizontal axis (top is symmetrical to bottom, left to right). So with Gimp, I measured precisely the coordinates of the centers of all objects. I ended with a LibreOffice spreadsheet.

 

 First try...

My attempt to created the SVG with Inkscape went nowehere. Happily, I quick search on Google shows writing a SVG file is rather simple. Here is my first SVG:

  <svg height="100" width="100">
    <circle cx="100" cy="100" r="100" style="fill:rgb(192,192,255);stroke:none;stroke-width:1" />
    <rect x="0" y="0" width="40" height="40" style="fill:rgb(147,147,255);stroke:none;stroke-width:1" />
    <rect x="16" y="16" width="35" height="35" style="fill:rgb(127,127,245);stroke:none;stroke-width:1" />
    <rect x="32" y="32" width="27" height="27" style="fill:rgb(107,107,235);stroke:none;stroke-width:1" />
    <rect x="48" y="48" width="17" height="17" style="fill:rgb(87,87,225);stroke:none;stroke-width:1" />
  </svg>

The result is:

Full documentation available here: https://developer.mozilla.org/en-US/docs/Web/SVG

The spreasheet

For my project, I need to cut 3 sheets: the casing (metal, 1.3 mm), a plastic sheet (lexan) containg the silkscreen, and another metal sheet holding the PCB. The need for 2 metal sheets is leaded to the fact by buttons are enclosed between the two sheets. The coordinate set is differents for each sheet.

In my spreasheet, the columns were:
A: Object Id (unused)
B: Object Label (unused)
C: Object Type on sheet 1 & 2: rect, circle or path
D: Object Type on sheet 3: rect, circle or path
E: Object width in mm
F: Object height in mm
G: Object absolute x in mm
H: Object absolute y in mm
I:  Object x relative to the casing (identical to G)
J:  Object y relative to the casing (identical to H)
K: SVG code for the objects, relative to the casing
L: Object x relative to the silkscreen
M: Object y relative to the silkscreen
N: SVG code for the objects, relative to the silkscreen

In column K, I created a formula to generate all the paths:
="<" & $C4 &
     IF($C4="rect",
  " x=""" & ROUND(Params.$B$1*(L4-$E4/2),3) & """" &
  " y=""" & ROUND(Params.$B$1*(M4-$F4/2),3) & """" &
  " width=""" & ROUND(Params.$B$1*($E4),3) & """" &
  " height=""" & ROUND(Params.$B$1*($F4),3),
     IF($C4="circle",
  " cx=""" & ROUND(Params.$B$1*(L4),3) & """" &
  " cy=""" & ROUND(Params.$B$1*(M4),3) & """" &
  " r=""" & ROUND(Params.$B$1*($F4/2),3),
     IF($C4="path",
  " d=""M" & ROUND(Params.$B$1*(L4-$E4/2),3) & "," & ROUND(Params.$B$1*(M4-$F4/2+Params.$B$2),3) &
  " C" & ROUND(Params.$B$1*(L4-$E4/2),3) & "," & ROUND(Params.$B$1*(M4-$F4/2),3) &
   " " & ROUND(Params.$B$1*(L4+$E4/2),3) & "," & ROUND(Params.$B$1*(M4-$F4/2),3) &
   " " & ROUND(Params.$B$1*(L4+$E4/2),3) & "," & ROUND(Params.$B$1*(M4-$F4/2+Params.$B$2),3) &
  " L" & ROUND(Params.$B$1*(L4+$E4/2),3) & "," & ROUND(Params.$B$1*(M4+$F4/2-Params.$B$2),3) &
  " C" & ROUND(Params.$B$1*(L4+$E4/2),3) & "," & ROUND(Params.$B$1*(M4+$F4/2),3) &
   " " & ROUND(Params.$B$1*(L4-$E4/2),3) & "," & ROUND(Params.$B$1*(M4+$F4/2),3) &
   " " & ROUND(Params.$B$1*(L4-$E4/2),3) & "," & ROUND(Params.$B$1*(M4+$F4/2-Params.$B$2),3) &
   " L" & ROUND(Params.$B$1*(L4-$E4/2),3) & "," & ROUND(Params.$B$1*(M4-$F4/2+Params.$B$2),3), "" )))
 & """ " &Params.$B$3&" />"


Where Params.$B$1 contains a scaling ratio (90*177/(25.4*270)=2.3228346457) and Params.$B$2 contains a rounding factor for the path objects.
This gave the following result (abstract):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="1012.756" height="411.142" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:ev="http://www.w3.org/2001/xml-events"
    version="1.1"
    baseProfile="full">

<rect x="50.998" y="358.762"
    width="25.296"

    height="12.311"
    style="fill:#000000;fill-opacity:1;
        fill-rule:evenodd;stroke:none;
        stroke-width:1px;stroke-linecap:butt;
        stroke-linejoin:miter;stroke-opacity:1" />
<circle cx="63.646" cy="347.264" r="3.484"
    style="fill:#000000;fill-opacity:1;
        fill-rule:evenodd;stroke:none;
        stroke-width:1px;stroke-linecap:butt;
        stroke-linejoin:miter;stroke-opacity:1" />
...
<path d="M115.213,206.616
    C115.213,201.97 123.343,201.97 123.343,206.616
    L123.343,286.754
    C123.343,291.4 115.213,291.4 115.213,286.754
    L115.213,206.616"
    style="fill:#000000;fill-opacity:1;
        fill-rule:evenodd;stroke:none;
        stroke-width:1px;stroke-linecap:butt;
        stroke-linejoin:miter;stroke-opacity:1" />
...


Nice! The fact I had to repeat the style tag on every line is due to a bug when importing in FreeCAD.

The overall result is the following:


A closer look:


In FreeCAD, I could create the casing:

Monday, 31 October 2016

Visio 2010: On connectors, how to align the text alongside the path

On Visio 2010, the text on the connector is always horizontal by default.

When the Visio becomes crowdy, it might be useful to set the text alongside the connector path.
On, in a more general way...
 

How to...

In the option menu, enable the Developper Mode

Now you can left-click on any link to display the ShapeSheet

In the ShapeSheet, go to the Text Transform section



In the TxtAngle setting, replace the current angle (0 deg) by this formula:
=ANGLEALONGPATH(Geometry1.Path,1)+IF(COS(ANGLEALONGPATH(Geometry1.Path,1))>=0,0,180°)


Friday, 28 October 2016

Comprendre les tentatives d'hameçonnage (phishing)

Pour ne pas tomber dans le piège...

Je reçois depuis quelques jours des courriels très bien faits m'invitant à consulter mon compte Paypal ou m'indiquant qu'un colis n'a pu être délivré par UPS. Et le hasard fait que je reçois ce courriel justement le lendemain d'un achat.

Ces courriels sont faux et ne sont que des tentatives d'hameçonnage (phishing) afin de récolter des informations personnelles.

Vers où veut-on m'amener ?

En passant la souris sur les liens (SANS CLIQUER !), des détails s'affichent en bas de l'écran. Le lien nous amène vers epl.paypal-communication.com/... ou epl.ups-delirery.com/...


Alors, des vrais ou des faux ?

Les noms de dommaines sont gérés de manière internationale, en collaboration entre les pays. Tout en haut de la pyramide se trouve un organisme américain, l'ICANN.

Pour vérifier un nom de domaine, on peut recourir au service whois de l'ICANN.

Est-ce que UPS est vraiment UPS ?

Interrogeons l'ICANN...
https://whois.icann.org/en/lookup?name=ups.com

La réponse nous donne:
Contact Information

Registrant Contact
Name: Domain Administrator
Organization: United Parcel Service of America, Inc.
Mailing Address: 340 Macarthur Blvd, Mahwah NJ 07630 US
Phone: +1.2018282480
Ext:
Fax:
Fax Ext:
Email:internet@ups.com

Admin Contact
Name: Domain Administrator
Organization: United Parcel Service of America, Inc.
Mailing Address: 340 Macarthur Blvd, Mahwah NJ 07630 US
Phone: +1.2018282480
Ext:
Fax:
Fax Ext:
Email:internet@ups.com

Tech Contact
Name: Domain Administrator
Organization: United Parcel Service of America, Inc.
Mailing Address: 340 Macarthur Blvd, Mahwah NJ 07630 US
Phone: +1.2018282480
Ext:
Fax:
Fax Ext:
Email:internet@ups.com

C'est bien UPS.

Par contre, si on interroge l'ICANN au sujet de ups-delivery.com...
https://whois.icann.org/en/lookup?name=ups-delivery.com

La réponse est bien différente...

Contact Information

Registrant Contact
Name: hui liu
Organization: liuhui
Mailing Address: jinggangshan road 103,,, ji an shi jiang xi 343000 CN
Phone: +86.7968345588
Ext:
Fax: +86.7968345588
Fax Ext:
Email:285997125@qq.com

Admin Contact
Name: hui liu
Organization: liuhui
Mailing Address: jinggangshan road 103,,, ji an shi jiang xi 343000 CN
Phone: +86.7968345588
Ext:
Fax: +86.7968345588
Fax Ext:
Email:285997125@qq.com

Tech Contact
Name: hui liu
Organization: liuhui
Mailing Address: jinggangshan road 103,,, ji an shi jiang xi 343000 CN
Phone: +86.7968345588
Ext:
Fax: +86.7968345588
Fax Ext:
Email:285997125@qq.com

Ça n'a évidemment rien à voir avec UPS, ni même avec une branche chinoise d'UPS.

Et pour Paypal ?

Dans ce cas ci, la réponse en plus troublante:
https://whois.icann.org/en/lookup?name=paypal-communication.com

Contact Information

Registrant Contact
Name: Domain Administrator
Organization: PayPal Inc.
Mailing Address: 2211 North First Street,, San Jose CA 95131 US
Phone: +1.8882211161
Ext:
Fax: +1.4025375774
Fax Ext:
Email:hostmaster@paypal.com

Admin Contact
Name: Domain Administrator
Organization: PayPal Inc.
Mailing Address: 2211 North First Street,, San Jose CA 95131 US
Phone: +1.8882211161
Ext:
Fax: +1.4025375774
Fax Ext:
Email:hostmaster@paypal.com

Tech Contact
Name: Domain Administrator
Organization: PayPal Inc.
Mailing Address: 2211 North First Street,, San Jose CA 95131 US
Phone: +1.8882211161
Ext:
Fax: +1.4025375774
Fax Ext:
Email:hostmaster@paypal.com

Il s'agit bien de Paypal :-/

Dans les faits, paypal-communication.com est une branche marketing de Paypal; de toutes façons, je n'ai pas à fournir des informations autres que ce que Paypal connait déjà.

Conclusion

Ne jamais cliquer sur les liens inclus dans les courriels. Dans le doute, aller directement sur le site (Paypal, UPS, ...).

Friday, 14 October 2016

A new folk


A new folk reach my studio: an EMU Proteus 2500.

Comprehensive design with many bells and whistles (layering, multi-track sequencer, arpeggiator, 2 FX engines) and a huge user manual - 356 pages. I only scratched the surface so far; the built in patches are weak by nowadays standards, but the filters are still simply ... wow!

Friday, 30 September 2016

Recreating the Roland MPG80

The rackmount version of the Roland Jupiter 6 was the MKS-80, released in 1984. A dedicated programmer was then available, the MPG80.


30 years later, the MKS-80 is a sought after intrument and the MPG-80 is even rarer.

My project is to recreate a MPG-80, based on modern components, Because of the position of the MPG-80 in the MIDI chain, I take this opportunity to add some goodies:
- a main power switch to swith on/off both units
- a upper/lower toggle switch which avoids to select it on the MKS-80
- an arpeggiator syncable on MIDI and External trigger
- More memory to store paches and tones
- Menu switches & LCD display to add further goodies


In the original MPG-80, there is no feedback from the MKS-80. Hence, no protocol is possible (ie the MPG-80 cannot read the settings from a patch; it only sends the new values to the MKS-80).

In the new version, there are 2 MIDI IN, which allows a feedback from the MKS-80. The MPG-80 can request the parameters from a patch and change the LED display accordingly.
The second MIDI IN allows the keyboard to drive the internal arpeggiator, such as on the Roland Jupiter 6. Furthermore, I added an analog sync in / sync out to allow syncing the arpeggiator clock to an analog signal, or syncing an external arpeggiator (such as Roland Juno or Korg Polysix) to the MIDI clock.

Current status:
- Redesign of the pannel layout: finished
- Redesign of the electronic: almost finished
- Programming: started
- Redesign of the casing:started

Monday, 22 August 2016

Atari Wiki

Recently found, an up-to-date wiki on the old faithfull Atari:
http://www.atari-wiki.com/index.php/Main_Page