Free plug-in to export curves

If you are using CADEMIA and miss something you'd like to see in the future, post your request here.

Free plug-in to export curves

Postby bf » Fri Jul 08, 2011 3:13 pm

CADEMIA users from India asked us about a possibility to construct and export curves to a text file. The construction methods are already contained in CADEMIA. The export, however, is missing. This is an ideal application for CADEMIA.

The developed plug-in is attached to this post. Just download the file (size 8 KB) and add the plug-in to CADEMIA via the menu bar "Misc > Add plugin". A menu choice "Export" will appear.

Now load an existing database containing curves or construct new ones. From the menu bar then chose "Export > Curves". All curves of type Line, Arc, Circle and Path will be exported to the selected text file. The export can be restricted to single components by selecting them.

In case you need the source code of this plug-in please feel free to send us an email.

Description of the export format:

Code: Select all
    COMP name type
    MOVETO p_x p_y
    LINETO ep_x ep_y
    ARCTO ap_x ap_y ep_x ep_y
    QUADTO cp_x cp_y ep_x ep_y
    CUBICTO cp1_x cp1_y cp2_x cp2_y ep_x ep_y
    CLOSE

    where
        COMP: Indicates the start of a new curve
        MOVETO: moves the actual position to point p
        LINETO: line from actual positon to point ep
        ARCTO: arc from actual position through point ap to point ep
        QUADTO: quadratic Bezier curve with control point cp from actual position to point ep
        CUBICTO: cubic Bezier curve with control points cp1 and cp2 from actual position to point ep
        CLOSE: closes the sub curve to the last MOVETO location
Attachments
export_curves.cademia_plugin
export curves plugin
(6.21 KiB) Downloaded 95 times
Berthold Firmenich
bf
 
Posts: 114
Joined: Wed Jun 20, 2007 8:47 am
Location: Germany

Return to CADEMIA user feature requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron