檔案圖示
 
 

1658

Parametric SVG

作者 Frank

This Extension allows you to embed a python script in the svg document, in that script you can define vars and functions (any python code really)...

Then you can create parametric attributes in your svg objects. a parametric attribute is an attribute prefixed with parametric namespace, this attribute can contain any valid python expression which will be evaluated by this extension and the result will be set to the real attribute (without namespace)

for example:

# Import utilities

from pyscript import svg
import math

# Simple rotation

# 1. Get the Element
element = ink.select_first('#arrow')

# 2. Parse the element
path = svg.PathObject( node = element )

# 3. Rotate path
path.rotate( math.radians ( 30 ) ) # take into account inkscape inverted coordinate system

# 4. Update element
path.commit()

Project page: https://gitlab.com/mnesarco/inkscape-pyscript

Inkscape Extensions

大小
175.8 KB
建立時間
修訂
4
類型
application/zip
General Public License v2 (GPLv2)

連結

brynn 寫於

Hello,
Thank you for providing this extension for Inkscape users!

This is just to let you know that most 3rd party Inkscape extensions, like this one, probably will not work with the upcoming new Inkscape version, the long-awaited version 1.0.

Here is the info you need to update this extension, so that it will work with 1.0 and future versions.
https://wiki.inkscape.org/wiki/index.php?title=Updating_your_Extension_for_1.0

If you have further questions, you can contact Inkscape developers via mailing lists (https://lists.inkscape.org/postorius/lists/?all-lists), forum (https://inkscape.org/forums/extensions/), or the chatroom (https://chat.inkscape.org/channel/team_devel)

If you have already updated it, please disregard this message.

All best,
brynn

Frank 寫於

Hello, this project was moved to gitlab, new version supports:

- Extensions API 1.0 (for inkscape 1.0)
- Full document manipulation
- Builtin code editor
- Namespaces...

https://gitlab.com/mnesarco/inkscape-pyscript

登入以留下評註!