mirror of
git://projects.qi-hardware.com/m1.git
synced 2024-11-16 18:24:59 +02:00
convert dxf into svg instead of png
This commit is contained in:
parent
8afc8d57c2
commit
98f4ce15ab
1
cad/.gitignore
vendored
1
cad/.gitignore
vendored
@ -1 +1,2 @@
|
||||
milkymist-assemble-howto.pdf
|
||||
protocase_v7_laser.svg
|
||||
|
15
cad/Makefile
15
cad/Makefile
@ -1,4 +1,4 @@
|
||||
all: milkymist-assemble-howto.pdf protocase_v7_laser.png
|
||||
all: milkymist-assemble-howto.pdf protocase_v7_laser.svg
|
||||
|
||||
#
|
||||
# install fonts for example into ~/.fonts
|
||||
@ -9,15 +9,12 @@ milkymist-assemble-howto.pdf: milkymist-assemble-howto.svg
|
||||
inkscape -A $@ $<
|
||||
|
||||
TMP1 := $(shell mktemp)
|
||||
TMP2 := $(shell mktemp)
|
||||
|
||||
# process with xsltproc to make the lines thicker and more visible in the PNG
|
||||
protocase_v7_laser.png: protocase_v7_laser.dxf
|
||||
dia -e $(TMP1) -t dia $<
|
||||
zcat $(TMP1) | xsltproc --stringparam line_width 0.5 dia_set_line_width.xsl - | gzip > $(TMP2)
|
||||
dia -e $@ -t png -s x500 $(TMP2)
|
||||
rm -f $(TMP1) $(TMP2)
|
||||
protocase_v7_laser.svg: protocase_v7_laser.dxf
|
||||
dia -e $(TMP1) -t svg $<
|
||||
sed -e 's/stroke-width: 0.02/stroke-width: 10/' $(TMP1) > $@
|
||||
rm -f $(TMP1)
|
||||
|
||||
clean:
|
||||
rm -f milkymist-assemble-howto.pdf
|
||||
rm -f protocase_v7_laser.png
|
||||
rm -f protocase_v7_laser.svg
|
||||
|
@ -1,41 +0,0 @@
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:dia="http://www.lysator.liu.se/~alla/dia/" >
|
||||
|
||||
<xsl:output method="xml" encoding="UTF-8" />
|
||||
|
||||
<xsl:param name="line_width" />
|
||||
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<!--xsl:template match="dia:real" >
|
||||
<xsl:element name="dia:real">
|
||||
<xsl:attribute name="val">
|
||||
<xsl:value-of select="$line_width" />
|
||||
</xsl:attribute>
|
||||
</xsl:element >
|
||||
</xsl:template-->
|
||||
|
||||
<!-- xsl:template match="dia:attribute[@name='line_width']/dia:real" >
|
||||
<dia:attribute name="line_width">
|
||||
<xsl:element name="dia:real">
|
||||
<xsl:attribute name="val">
|
||||
<xsl:value-of select="$line_width" />
|
||||
</xsl:attribute>
|
||||
</xsl:element >
|
||||
</dia:attribute>
|
||||
</xsl:template -->
|
||||
|
||||
<xsl:template match="dia:attribute[@name='line_width']/dia:real" >
|
||||
<xsl:element name="dia:real">
|
||||
<xsl:attribute name="val">
|
||||
<xsl:value-of select="$line_width" />
|
||||
</xsl:attribute>
|
||||
</xsl:element >
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
Loading…
Reference in New Issue
Block a user