Working with DXF Files in Adobe AIR

classic Classic list List threaded Threaded
7 messages Options
Ale
Reply | Threaded
Open this post in threaded view
|

Working with DXF Files in Adobe AIR

Ale
Hi,

I need to show a DXF file in an Adobe AIR application. What I have seen is
that I will probably have to convert it to a suitable file type such as FXG
for Flex. I wonder if there is any library or something to make this
conversion.

It would be fine any other ideas instead of libraries for conversion having
in mind that what I need is to show the content of DXF file into my
application.

Thanks,

Ale



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Working with DXF Files in Adobe AIR

Javier Guerrero García
There are plenty of DXF->SVG conversion tools: https://www.dxfconverter.org/

Surely you won't have much trouble rendering the SVG in your app and retain
full vector resolution if you need to, but it could be slow to render. You
might also want consider rendering the DXF as a bitmap at your top device
resolution, and just placing it in your app (if you set a maximum zoom to
match 1:1 device resolution with the bitmap resolution, there shouldn't be
much difference either way).

On Thu, Jul 26, 2018 at 12:45 PM, Ale <[hidden email]> wrote:

> Hi,
>
> I need to show a DXF file in an Adobe AIR application. What I have seen is
> that I will probably have to convert it to a suitable file type such as FXG
> for Flex. I wonder if there is any library or something to make this
> conversion.
>
> It would be fine any other ideas instead of libraries for conversion having
> in mind that what I need is to show the content of DXF file into my
> application.
>
> Thanks,
>
> Ale
>
>
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
>
Ale
Reply | Threaded
Open this post in threaded view
|

Re: Working with DXF Files in Adobe AIR

Ale
Hi Javier,

Thanks for your reply.

I guess SVG is a good format to convert for using it in the application. The
main problem is that I need to make this conversion at runtime. That is why
I think I would need some external library that helps me out doing it.

I have also thought about getting the DXF file into any kind of bitmap
representation but I just don't know how I could do that with Flex/AS3
language.

Thanks,

Ale



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Working with DXF Files in Adobe AIR

Olaf Krueger
Reply | Threaded
Open this post in threaded view
|

Re: Working with DXF Files in Adobe AIR

Olaf Krueger
Maybe I should add some more words to my last post:
If you don't find an "AS3 DXF converter implementation" out there I guess
you have at least those options:

- Grab one of those libs out there, put it on a server and deliver it
as-a-service
- Grab one of those libs out there, install/deploy it locally and try to
call it from your AIR app
- Consume an external service which is already there

HTH,
Olaf





--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Working with DXF Files in Adobe AIR

Javier Guerrero García
In reply to this post by Ale
The "runtime" requirement sounds a bit strange (not knowing anything about
your app), since it would involve something generating/updating a DXF in
realtime while your app needs to access it (otherwise, you could perform
your conversion.

If you do need that realtime, I would go for server side scripting with
LibreDWG as Olaf suggested (it has a dxf2svg converter indeed:
https://github.com/LibreDWG/libredwg/blob/master/programs/dwg2SVG.c) or
something similar, and then send the generated SVG to your app as a
response.

Sounds a long-shot though ;-)

On Fri, Jul 27, 2018 at 10:16 AM, Ale <[hidden email]> wrote:

> Hi Javier,
>
> Thanks for your reply.
>
> I guess SVG is a good format to convert for using it in the application.
> The
> main problem is that I need to make this conversion at runtime. That is why
> I think I would need some external library that helps me out doing it.
>
> I have also thought about getting the DXF file into any kind of bitmap
> representation but I just don't know how I could do that with Flex/AS3
> language.
>
> Thanks,
>
> Ale
>
>
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
>
Reply | Threaded
Open this post in threaded view
|

Re: Working with DXF Files in Adobe AIR

Olaf Krueger
>Sounds a long-shot though ;-)

If you need a starting point on how to provide dxf2svg as a service, maybe
this [1] helps.
This is a simple NodeJS/Restify implementation in order to provide the
"Apache Royale Compiler" as-a-service. The Readme [2] explains how it works.
Notice that the code is just a proof of concept and that it's still work in
progress.

However, I guess you could easily replace the Royale command with the
related dxf2svg command.
Of course, you have to do some more adjustments but in the best case, this
could be done in a couple of minutes ;-)

HTH,
Olaf

[1]
https://github.com/apache/royale-website/blob/try-it-now/try-it-now/server/server.js
[2]
https://github.com/apache/royale-website/blob/try-it-now/try-it-now/server/README.md




--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/