Thom's egg calligraphy

Discussion about writing code for Inkscape.
Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Thom's egg calligraphy

Postby Lazur » Mon May 13, 2013 2:29 am

It is for the same idea, that was presented here.

I want to create a calligraphed letter shape in 3D with blender.
The only way that works, is to create the 3D shape from it's isolines, that are constructed in 2D.
That means, creating geometrically correct representation of calligraphed strokes with some customised pen shapes.

So there are thing that I should write some extensions for.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Thom's egg calligraphy

Postby Lazur » Mon May 13, 2013 3:08 am

I will break this to sections, as there are different extensions/extension parts to be coded.

First, a simple one: Thom's egg extension.

Here is a description of the Thom's egg:
http://mathworld.wolfram.com/ThomsEggs.html

Basically I refer to it as a symmerical curve,
that has tangents in the starting point perpendicular to the line aligned to them,
and wich is constructed of 3 circles, two of them with the same radius.

This kind of curve is very helpful in designing letters.
It looks similar to an ellipse, that is a basic shape in calligraphy, but with a big differnece:
If you draw a curve fatter, it will remain constructed of circular curves, while ellipse fattened won't be an ellipse.

Structure of a basic curve:

Image

Comparision with an ellipse of the same size:

Image
Last edited by Lazur URH on Mon May 27, 2013 3:06 am, edited 6 times in total.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Thom's egg calligraphy

Postby Lazur » Mon May 13, 2013 3:56 am

Constructing a Thom's egg is useful only if you can draw it with exact dimensions,
with an exact width and height given.

The basic workaround is as follows:
-divide a 90° circle arch into two parts
-draw a rectangle which the quarter of the Thom's egg will be in
-draw parallel lines through the rectangle's to opposite corners,
that are parallel with straight lines defined by the starting points of the right arches
-scale each arch to fit the section point of the two previous lines when aligned to the rectangle's corners

SVG Image

Until there will be a built-in solution for such -"dyanmic block suggestion", that you could change the two arches radius with a handle,
without affecting the overall dimensions, an extension for drawing such would be handy.
(Couldn't find my previous post on that suggestion which included some imagery.)
Last edited by Lazur URH on Mon May 13, 2013 5:15 am, edited 1 time in total.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Thom's egg calligraphy

Postby Lazur » Mon May 13, 2013 4:12 am

Speaking of wich, here is the inx file that I would start the coding with:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
  <_name>thom</_name>
  <id>org.inkscape.effect.thom</id>
  <dependency type="executable" location="extensions">thom.py</dependency>
  <dependency type="executable" location="extensions">inkex.py</dependency>
  <param name="tab" type="notebook">
    <page name="parameters" _gui-text="Parameters:">
      <param precision="5" param name="width" type="float" min="0.0" max="10000.0" _gui-text="width in mm">275</param>
      <param precision="5" param name="height" type="float" min="0.0" max="10000.0" _gui-text="height in mm">140</param>
      <param name="resolution" type="int" min="2" max="90" _gui-text="number of arches on a 90° turn">50</param>
      <param name="arch" type="int" min="1" max="89" _gui-text="number of top arches segments">25</param>
    </page>
  <effect>
    <object-type>all</object-type>
    <effects-menu>
      <submenu _name="Render"/>
    </effects-menu>
  </effect>
  <script>
    <command reldir="extensions" interpreter="python">thom.py</command>
  </script>
</inkscape-extension>


Another thing not mentioned before is, that for the modelling purpose, the curve needs to be constructed from segments wich have equal rotation.
That's what the resolution part would be for, and also the angle where the arches will meet are defined with such numbers, not with degrees.

Off topic:
Don't know why the svg tags don't render right in this thread. Is This a forum's setting, or that I can't embed an svg straight from dropbox?

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Thom's egg calligraphy

Postby ragstian » Mon May 13, 2013 4:48 am

Hi.

Off topic:
Don't know why the svg tags don't render right in this thread.
Is This a forum's setting, or that I can't embed an svg straight from dropbox?
Re: Thom's egg calligraphy


Do you want the image to display?
Not sure if you can display the SVG directly from dropbox.
When I use dropbox I export the image to two PNG files - one for the image and one for the image thumbnail.
Took me a day of experimenting before I got it working! :D
The URL Tag I use looks like this - (IMPORTANT; dl instead of www in the first part and the ?dl=1 after the thumbnail file name in the last part)

Code: Select all

[url=https://dl.dropbox.com/s/pn597xmqun5luu0/Image.png][img]https://www.dropbox.com/s/abucuylikki9530/Image_TN.png?dl=1[/img][/url]


RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Thom's egg calligraphy

Postby Lazur » Mon May 13, 2013 5:16 am

Thank's!

Now I could get those svg's to work. Why to export to png-s, I'm not a render farm...

Off topic:
The only reason for that would be that it displays a bit different in the browsers.
That ellipse was scaled with numbers input for the dimensions, thus the outlines are optimised by inkscape -or not?
When I turned the outlines to paths, it turned as it wouldn't have such. Didn't change it in the preferences, so have no idea what could be wrong.
In firefox it is displayed right, in chrome it isn't.



This is what did the trick:

Code: Select all

[url=https://dl.dropbox.com/s/ykt8en46droqya0/thom3.svg][svg]https://dl.dropbox.com/s/ykt8en46droqya0/thom3.svg[/svg][/url]
Last edited by Lazur URH on Mon May 13, 2013 6:22 am, edited 3 times in total.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Thom's egg calligraphy

Postby ragstian » Mon May 13, 2013 5:21 am

Hi.

Clever!
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar


Return to “Programming”