von guy.brush™ » Sa 12. Nov 2011, 20:08
Hallo,
also ich habe bisher eine evtl. Lösung gefunden:
Inkscape -> Kartoffel erstellen -> mit dem Plugin "inkscape2tikz" den Code in tikz-Code exportieren lassen -> ein kleines Ruby-Skript rechnet mir dann die Koordinaten von pt in cm um und rundet auf 2 Stellen. Dies scheint so weit ganz gut zu funktionieren, aber inkscape2tikz macht etwas komisches:
Und zwar werden zumindest die Zeichnungen (immerhin Text nicht) gespiegelt ausgegeben und dann mit "yscale=-1" korrigiert.
Beispiel:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt]
% path2985
\path[draw=black] (303.1740,214.1497) .. controls (292.5144,231.5953) and
(337.4464,244.4464) .. (337.6299,264.8901) .. controls (337.7337,276.4601) and
(326.7513,285.6923) .. (318.6483,293.9518) .. controls (302.1399,310.7789) and
(283.7612,333.4445) .. (260.1903,333.7487) .. controls (250.9291,333.8682) and
(241.3198,326.8089) .. (236.8260,318.7102) .. controls (223.8997,295.4149) and
(260.4629,248.5829) .. (235.6850,238.7944) .. controls (203.2440,225.9785) and
(191.9171,333.7855) .. (163.0848,314.1548) .. controls (147.5476,303.5762) and
(194.5166,279.8851) .. (186.5296,262.8698) .. controls (179.2830,247.4316) and
(144.6349,264.8257) .. (137.1429,249.5050) .. controls (128.7658,232.3745) and
(158.0378,215.7745) .. (159.2555,196.7443) .. controls (159.9195,186.3675) and
(144.8089,175.0539) .. (150.9630,166.6725) .. controls (158.9135,155.8446) and
(180.1232,172.8052) .. (191.2383,165.2614) .. controls (215.6100,148.7203) and
(197.2712,84.0241) .. (226.7244,84.3353) .. controls (255.9137,84.6437) and
(241.8931,142.5166) .. (260.1903,165.2614) .. controls (267.3569,174.1701) and
(278.3728,179.2600) .. (288.3437,184.8553) .. controls (315.8690,200.3011) and
(383.3852,192.5781) .. (375.0056,223.0083) .. controls (368.6006,246.2677) and
(315.7528,193.5632) .. (303.1740,214.1497) -- cycle;
\end{tikzpicture}
\end{document}
Kann sich vielleicht jemand erklären, warum das so sein könnte?
Viel wichtiger aber: Fällt einem (vielleicht erfahreneren User) auf, wie problematisch das bei der manuellen Weiterverarbeitung des Codes werden könnte?
Ich könnte zwar dann die Kartoffel mit einer scope-Umgebung und "yscale=-1" in meine tikz-Zeichnungen einbetten, aber wenn ich dann innerhalb der Kartoffel etwas zeichnen, ändern oder sonst etwas möchte ... dann muss ich das doch alles gespiegelt machen, oder nicht? Das stelle ich mir etwas kompliziert vor.
Ein Workaround wäre, schon in Inkscape die Kartoffeln auf dem Kopf gespiegelt zu erstellen, aber gerade bei komplizierteren Formen wird das auch etwas unübersichtlicher.
Viele Grüße,
\\ guy.brush
Hallo,
also ich habe bisher eine evtl. Lösung gefunden:
Inkscape -> Kartoffel erstellen -> mit dem Plugin "inkscape2tikz" den Code in tikz-Code exportieren lassen -> ein kleines Ruby-Skript rechnet mir dann die Koordinaten von pt in cm um und rundet auf 2 Stellen. Dies scheint so weit ganz gut zu funktionieren, aber inkscape2tikz macht etwas komisches:
Und zwar werden zumindest die Zeichnungen (immerhin Text nicht) gespiegelt ausgegeben und dann mit "yscale=-1" korrigiert.
Beispiel:
[code]
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt]
% path2985
\path[draw=black] (303.1740,214.1497) .. controls (292.5144,231.5953) and
(337.4464,244.4464) .. (337.6299,264.8901) .. controls (337.7337,276.4601) and
(326.7513,285.6923) .. (318.6483,293.9518) .. controls (302.1399,310.7789) and
(283.7612,333.4445) .. (260.1903,333.7487) .. controls (250.9291,333.8682) and
(241.3198,326.8089) .. (236.8260,318.7102) .. controls (223.8997,295.4149) and
(260.4629,248.5829) .. (235.6850,238.7944) .. controls (203.2440,225.9785) and
(191.9171,333.7855) .. (163.0848,314.1548) .. controls (147.5476,303.5762) and
(194.5166,279.8851) .. (186.5296,262.8698) .. controls (179.2830,247.4316) and
(144.6349,264.8257) .. (137.1429,249.5050) .. controls (128.7658,232.3745) and
(158.0378,215.7745) .. (159.2555,196.7443) .. controls (159.9195,186.3675) and
(144.8089,175.0539) .. (150.9630,166.6725) .. controls (158.9135,155.8446) and
(180.1232,172.8052) .. (191.2383,165.2614) .. controls (215.6100,148.7203) and
(197.2712,84.0241) .. (226.7244,84.3353) .. controls (255.9137,84.6437) and
(241.8931,142.5166) .. (260.1903,165.2614) .. controls (267.3569,174.1701) and
(278.3728,179.2600) .. (288.3437,184.8553) .. controls (315.8690,200.3011) and
(383.3852,192.5781) .. (375.0056,223.0083) .. controls (368.6006,246.2677) and
(315.7528,193.5632) .. (303.1740,214.1497) -- cycle;
\end{tikzpicture}
\end{document}
[/code]
Kann sich vielleicht jemand erklären, warum das so sein könnte?
Viel wichtiger aber: Fällt einem (vielleicht erfahreneren User) auf, wie problematisch das bei der manuellen Weiterverarbeitung des Codes werden könnte?
Ich könnte zwar dann die Kartoffel mit einer scope-Umgebung und "yscale=-1" in meine tikz-Zeichnungen einbetten, aber wenn ich dann innerhalb der Kartoffel etwas zeichnen, ändern oder sonst etwas möchte ... dann muss ich das doch alles gespiegelt machen, oder nicht? Das stelle ich mir etwas kompliziert vor.
Ein Workaround wäre, schon in Inkscape die Kartoffeln auf dem Kopf gespiegelt zu erstellen, aber gerade bei komplizierteren Formen wird das auch etwas unübersichtlicher.
Viele Grüße,
\\ guy.brush