Re: [NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2017-07-27 Thread Mojca Miklavec
On 27 July 2017 at 10:49, Hans Hagen wrote:
> On 7/27/2017 3:52 AM, Mojca Miklavec wrote:
>>
>> Hi,
>>
>> I just wanted to say that I found a more reliable way to go from
>> metapost to dxf.
>>
>> First run "context something.mp" and then
>>
>> pstoedit -dt -f dxf:-polyaslines\ -mm something.1 something.dxf
>>
>> For some reason the SVG files from metapost get wrong dimensions when
>> converted via inkscape, but pstoedit works super reliably.
>
>
> in that case you can consider:
>
> mp -> pdf -> mudraw/mutool -> svg

The thing is: I don't need svg at all. All I need is dxf and now I
finally have a reliable way to get it from metapost via pstoedit. SVG
was just a workaround since converting from PDF was slightly more
difficult (latest versions of expensive tools provide that conversion
too, but OpenSource is more limited).

I could check if there's any difference in SVG code as generated by
metapost vs. the one generated by mudraw. But SVG images made by
CorelDraw were misconverted by Inkscape as well.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2017-07-27 Thread Hans Hagen

On 7/27/2017 3:52 AM, Mojca Miklavec wrote:

Hi,

I just wanted to say that I found a more reliable way to go from
metapost to dxf.

First run "context something.mp" and then

pstoedit -dt -f dxf:-polyaslines\ -mm something.1 something.dxf

For some reason the SVG files from metapost get wrong dimensions when
converted via inkscape, but pstoedit works super reliably.


in that case you can consider:

mp -> pdf -> mudraw/mutool -> svg


Mojca

On 29 June 2016 at 12:31, Mojca Miklavec wrote:

Hi,

I want to play with CNC and don't yet have any experience with CAD
software (nor the licence for the expensive ones) other than perhaps
some Blender, so I decided to try to use the super ugly route with
 metapost -> svg -> dxf -> g-code
for the first time.

I have a few questions.


/.../


(3) Is there any way to convince the SVG output mode to generate something like
 
rather than
 
because the program I use to convert SVG to DXF has troubles
interpreting "points" properly. I read somewhere that they assume 90
points per inch because that's Inkskape's default.

(4) Does anyone have a better proposal for conversion into DXF (or
G-code)? I'm currently playing with FreeCAD and I've seen some
tutorials showing that AutoCAD can open PDF directly, but I don't want
to buy AudoCAD just for the sake of converting files.

Thank you,
 Mojca

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2017-07-26 Thread Mojca Miklavec
Hi,

I just wanted to say that I found a more reliable way to go from
metapost to dxf.

First run "context something.mp" and then

pstoedit -dt -f dxf:-polyaslines\ -mm something.1 something.dxf

For some reason the SVG files from metapost get wrong dimensions when
converted via inkscape, but pstoedit works super reliably.

Mojca

On 29 June 2016 at 12:31, Mojca Miklavec wrote:
> Hi,
>
> I want to play with CNC and don't yet have any experience with CAD
> software (nor the licence for the expensive ones) other than perhaps
> some Blender, so I decided to try to use the super ugly route with
> metapost -> svg -> dxf -> g-code
> for the first time.
>
> I have a few questions.

/.../

> (3) Is there any way to convince the SVG output mode to generate something 
> like
> 
> rather than
> 
> because the program I use to convert SVG to DXF has troubles
> interpreting "points" properly. I read somewhere that they assume 90
> points per inch because that's Inkskape's default.
>
> (4) Does anyone have a better proposal for conversion into DXF (or
> G-code)? I'm currently playing with FreeCAD and I've seen some
> tutorials showing that AutoCAD can open PDF directly, but I don't want
> to buy AudoCAD just for the sake of converting files.
>
> Thank you,
> Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2017-02-16 Thread Mojca Miklavec
On 16 February 2017 at 21:07, William Adams wrote:
> Another option here would be to use a tool which directly accepts SVGs ---
> one free/opensource tool for that is PartKAM/MakerCAM.
>
> My apologies for the late response --- investigating this sort of thing
> myself, though I'll likely be using a proprietary tool, Carbide Create to
> drive either a Nomad or a Shapeoko.

Now that you brought this topic out of the dead ...

I managed to convert the SVG to DXF somehow back then (I'm not 100%
sure how exactly, perhaps I was using Inkscape), but it turned out
that the conversion was faulty and useless (it converted circles into
octagons, proper scaling was lost, etc.), but I only realized that
once I got to the machine with a limited time slot.

The software that was installed next to the CNC did not accept PDFs,
but eventually the "operator" pulled out his laptop with a newer
version of (commercial) software and eventually imported my PDFs to
get the models for the CNC (annoyed for the fact that I didn't bring
"ready-to-use" files). He earlier explained that we should avoid PDFs
(as they could be bitmap etc.), but of course the vector PDFs
generated by ConTeXt were fine.

(It will probably be a while until I will go there next.)

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2017-02-16 Thread William Adams
Another option here would be to use a tool which directly accepts SVGs ---
one free/opensource tool for that is PartKAM/MakerCAM.

My apologies for the late response --- investigating this sort of thing
myself, though I'll likely be using a proprietary tool, Carbide Create to
drive either a Nomad or a Shapeoko.

William

On Thu, Jun 30, 2016 at 3:15 AM, Hans Hagen  wrote:

> On 6/29/2016 10:49 PM, Mojca Miklavec wrote:
>
>> On 29 June 2016 at 14:12, Hans Hagen wrote:
>>
>>> On 6/29/2016 12:31 PM, Mojca Miklavec wrote:
>>>

 Hi,

 I want to play with CNC and don't yet have any experience with CAD
 software (nor the licence for the expensive ones) other than perhaps
 some Blender, so I decided to try to use the super ugly route with
 metapost -> svg -> dxf -> g-code
 for the first time.

 I have a few questions.

 (1) I love Hans' shortcuts in metafun, but I seem to remember that
 things
 like
 input metafun;
 or perhaps
 input mp-tool;
 used to work, so that I don't have to remember to use
 mpost -mem=metafun my-drawings.mp
 when compiling the graphics.

 Did the method with "input" ever work (or is it supposed to work)? Now
 I'm getting a bunch of weird errors.
 I would love to specify everything in the source file and then just
 call mpost. If that doesn't work, that's fine, I can still add
 "-mem=metafun", but ...

>>>
>>>
>>> input metafun.mpiv ;
>>>
>>
>> How should one properly compile that file then to get the SVG?
>>
>
> some mp directive (but i never tried) as i always just use \startMPpage ..
> \stopMPpage so that fonts etc work ok too
>
> Using just "mpost something.mp" doesn't work that way.
>>
>> (2) I guess that using "raw metapost" is the only sane way to generate
 SVG. If I use metapost inside ConTeXt that's probably not going to
 work, right?

 (3) Is there any way to convince the SVG output mode to generate
 something
 like
 
 rather than
 >>> >
 because the program I use to convert SVG to DXF has troubles
 interpreting "points" properly. I read somewhere that they assume 90
 points per inch because that's Inkskape's default.

>>>
>>> why not just
>>>
>>> \startMPpage
>>>   whatever you want
>>> \stopMPpage
>>>
>>> and then use mudraw (mutools) to go from pdf to svg (that's what i do
>>> when i
>>> need svg)
>>>
>>
>> Given that metapost supports SVG natively I imagined that it would
>> produce a simpler/cleaner output. Thanks a lot for the suggestion,
>> I'll test it.
>>
>
> the svg from pdf is normally quite simple as it just output the same
> paths, colors etc + text as outline
>
> It turned out that the (opensource) tools I used for converting SVG
>> into DXF gives very weird result, so I have to change the other parts
>> of the "toolchain" as well.
>>
>> Nevertheless, the question about whether one could convince MP to
>> output true units in cm/mm/in.--
>>
>
> no, but you can of course scale the whole lot just before shipping so that
> units represent cm
>
> -
>   Hans Hagen | PRAGMA ADE
>   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
> -
> 
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/list
> info/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki : http://contextgarden.net
> 
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2016-06-30 Thread Hans Hagen

On 6/29/2016 10:49 PM, Mojca Miklavec wrote:

On 29 June 2016 at 14:12, Hans Hagen wrote:

On 6/29/2016 12:31 PM, Mojca Miklavec wrote:


Hi,

I want to play with CNC and don't yet have any experience with CAD
software (nor the licence for the expensive ones) other than perhaps
some Blender, so I decided to try to use the super ugly route with
metapost -> svg -> dxf -> g-code
for the first time.

I have a few questions.

(1) I love Hans' shortcuts in metafun, but I seem to remember that things
like
input metafun;
or perhaps
input mp-tool;
used to work, so that I don't have to remember to use
mpost -mem=metafun my-drawings.mp
when compiling the graphics.

Did the method with "input" ever work (or is it supposed to work)? Now
I'm getting a bunch of weird errors.
I would love to specify everything in the source file and then just
call mpost. If that doesn't work, that's fine, I can still add
"-mem=metafun", but ...



input metafun.mpiv ;


How should one properly compile that file then to get the SVG?


some mp directive (but i never tried) as i always just use \startMPpage 
.. \stopMPpage so that fonts etc work ok too



Using just "mpost something.mp" doesn't work that way.


(2) I guess that using "raw metapost" is the only sane way to generate
SVG. If I use metapost inside ConTeXt that's probably not going to
work, right?

(3) Is there any way to convince the SVG output mode to generate something
like

rather than

because the program I use to convert SVG to DXF has troubles
interpreting "points" properly. I read somewhere that they assume 90
points per inch because that's Inkskape's default.


why not just

\startMPpage
  whatever you want
\stopMPpage

and then use mudraw (mutools) to go from pdf to svg (that's what i do when i
need svg)


Given that metapost supports SVG natively I imagined that it would
produce a simpler/cleaner output. Thanks a lot for the suggestion,
I'll test it.


the svg from pdf is normally quite simple as it just output the same 
paths, colors etc + text as outline



It turned out that the (opensource) tools I used for converting SVG
into DXF gives very weird result, so I have to change the other parts
of the "toolchain" as well.

Nevertheless, the question about whether one could convince MP to
output true units in cm/mm/in.-- 


no, but you can of course scale the whole lot just before shipping so 
that units represent cm


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2016-06-29 Thread Jan Tosovsky
On 2016-06-29 Mojca Miklavec wrote:
> 
> I want to play with CNC and don't yet have any experience with CAD
> software (nor the licence for the expensive ones) other than perhaps
> some Blender, so I decided to try to use the super ugly route with
> metapost -> svg -> dxf -> g-code for the first time.

For simple shapes I'd choose Inkscape SVG editor, which can export to DXF 
directly. In settings you can customize the coords precision to reduce those 
fractions.

For more sophisticated designing I'd skip simple 2D CADs and use parametric 
tools instead (allowing to use equations instead of fixed values which 
simplifies future refactoring).

I'd recommend Autodesk Fusion, which is even free for enthusiasts:
https://knowledge.autodesk.com/support/fusion-360/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to-activate-start-up-or-educational-licensing-for-Fusion-360.html

https://www.youtube.com/watch?v=VzqXo0d0W8s

Jan

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2016-06-29 Thread Mojca Miklavec
On 29 June 2016 at 14:12, Hans Hagen wrote:
> On 6/29/2016 12:31 PM, Mojca Miklavec wrote:
>>
>> Hi,
>>
>> I want to play with CNC and don't yet have any experience with CAD
>> software (nor the licence for the expensive ones) other than perhaps
>> some Blender, so I decided to try to use the super ugly route with
>> metapost -> svg -> dxf -> g-code
>> for the first time.
>>
>> I have a few questions.
>>
>> (1) I love Hans' shortcuts in metafun, but I seem to remember that things
>> like
>> input metafun;
>> or perhaps
>> input mp-tool;
>> used to work, so that I don't have to remember to use
>> mpost -mem=metafun my-drawings.mp
>> when compiling the graphics.
>>
>> Did the method with "input" ever work (or is it supposed to work)? Now
>> I'm getting a bunch of weird errors.
>> I would love to specify everything in the source file and then just
>> call mpost. If that doesn't work, that's fine, I can still add
>> "-mem=metafun", but ...
>
>
> input metafun.mpiv ;

How should one properly compile that file then to get the SVG?

Using just "mpost something.mp" doesn't work that way.

>> (2) I guess that using "raw metapost" is the only sane way to generate
>> SVG. If I use metapost inside ConTeXt that's probably not going to
>> work, right?
>>
>> (3) Is there any way to convince the SVG output mode to generate something
>> like
>> 
>> rather than
>> 
>> because the program I use to convert SVG to DXF has troubles
>> interpreting "points" properly. I read somewhere that they assume 90
>> points per inch because that's Inkskape's default.
>
> why not just
>
> \startMPpage
>   whatever you want
> \stopMPpage
>
> and then use mudraw (mutools) to go from pdf to svg (that's what i do when i
> need svg)

Given that metapost supports SVG natively I imagined that it would
produce a simpler/cleaner output. Thanks a lot for the suggestion,
I'll test it.

It turned out that the (opensource) tools I used for converting SVG
into DXF gives very weird result, so I have to change the other parts
of the "toolchain" as well.

Nevertheless, the question about whether one could convince MP to
output true units in cm/mm/in.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2016-06-29 Thread Hans Hagen

On 6/29/2016 12:31 PM, Mojca Miklavec wrote:

Hi,

I want to play with CNC and don't yet have any experience with CAD
software (nor the licence for the expensive ones) other than perhaps
some Blender, so I decided to try to use the super ugly route with
metapost -> svg -> dxf -> g-code
for the first time.

I have a few questions.

(1) I love Hans' shortcuts in metafun, but I seem to remember that things like
input metafun;
or perhaps
input mp-tool;
used to work, so that I don't have to remember to use
mpost -mem=metafun my-drawings.mp
when compiling the graphics.

Did the method with "input" ever work (or is it supposed to work)? Now
I'm getting a bunch of weird errors.
I would love to specify everything in the source file and then just
call mpost. If that doesn't work, that's fine, I can still add
"-mem=metafun", but ...


input metafun.mpiv ;


(2) I guess that using "raw metapost" is the only sane way to generate
SVG. If I use metapost inside ConTeXt that's probably not going to
work, right?

(3) Is there any way to convince the SVG output mode to generate something like

rather than

because the program I use to convert SVG to DXF has troubles
interpreting "points" properly. I read somewhere that they assume 90
points per inch because that's Inkskape's default.


why not just

\startMPpage
  whatever you want
\stopMPpage

and then use mudraw (mutools) to go from pdf to svg (that's what i do 
when i need svg)



(4) Does anyone have a better proposal for conversion into DXF (or
G-code)? I'm currently playing with FreeCAD and I've seen some
tutorials showing that AutoCAD can open PDF directly, but I don't want
to buy AudoCAD just for the sake of converting files.

(Not to mention that FreeCAD's SVG importer crashes when reading
output from MetaPost unless I manually remove parts of the SVG, but
that's an unrelated problem that I'm somehow able to overcome.)

Thank you,
Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Creating SVG: using MetaFun, exporting proper units, conversion to DXF

2016-06-29 Thread Mojca Miklavec
Hi,

I want to play with CNC and don't yet have any experience with CAD
software (nor the licence for the expensive ones) other than perhaps
some Blender, so I decided to try to use the super ugly route with
metapost -> svg -> dxf -> g-code
for the first time.

I have a few questions.

(1) I love Hans' shortcuts in metafun, but I seem to remember that things like
input metafun;
or perhaps
input mp-tool;
used to work, so that I don't have to remember to use
mpost -mem=metafun my-drawings.mp
when compiling the graphics.

Did the method with "input" ever work (or is it supposed to work)? Now
I'm getting a bunch of weird errors.
I would love to specify everything in the source file and then just
call mpost. If that doesn't work, that's fine, I can still add
"-mem=metafun", but ...

(2) I guess that using "raw metapost" is the only sane way to generate
SVG. If I use metapost inside ConTeXt that's probably not going to
work, right?

(3) Is there any way to convince the SVG output mode to generate something like

rather than

because the program I use to convert SVG to DXF has troubles
interpreting "points" properly. I read somewhere that they assume 90
points per inch because that's Inkskape's default.

(4) Does anyone have a better proposal for conversion into DXF (or
G-code)? I'm currently playing with FreeCAD and I've seen some
tutorials showing that AutoCAD can open PDF directly, but I don't want
to buy AudoCAD just for the sake of converting files.

(Not to mention that FreeCAD's SVG importer crashes when reading
output from MetaPost unless I manually remove parts of the SVG, but
that's an unrelated problem that I'm somehow able to overcome.)

Thank you,
Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___