For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > August 2006 > canvas: auto-generate map similar to floorplan canvas demonstration









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author canvas: auto-generate map similar to floorplan canvas demonstration
jack london

2006-08-19, 9:59 pm

Hello,

I have an autocad map of my campsite and I would like to create a map
similar to the one in floorplan widget demonstration. Are there tools
to do this task? Or simply to help drawing the map and auto-convert
into points and lines needed to draw a canvas?

This is a chunk of code from floor.pl

$w->create('poly', qw(347 80 349 82 351 84 353 85 363 92 375 99 386
104 386 129 398 129 398 162 484 162 484 129 559 129 559
133 725 133 725 129 802 129 802 389 644 389 644 391 559 391 559 327
508 327 508 311 484 311 484 278 395 278 395 288 400
288 404 288 409 290 413 292 418 297 421 302 422 309 421 318 417 325
411 330 405 332 397 333 344 333 340 334 336 336 335
338 332 342 331 347 332 351 334 354 336 357 341 359 340 360 335 363
331 365 326 366 304 366 304 355 258 355 258 387 60
387 60 391 0 391 0 337 3 337 3 114 8 114 8 25 30 25 30 5 93 5 98 5 104
7 110 10 116 16 119 20 122 28 123 32 123 68 220
68 220 34 221 22 223 17 227 13 231 8 236 4 242 2 246 0 260 0 283 1 300
5 321 14 335 22 348 25 365 29 363 39 358 48 352
56 337 70 344 76 347 80), -tags => ['floor1', 'bg'], -fill => $fill);

$w->create('line', qw(386 129 398 129), -fill => $outline, -tags =>
['floor1', 'bg']);
$w->create('line', qw(258 355 258 387), -fill => $outline, -tags =>
['floor1', 'bg']);
$w->create('line', qw(60 387 60 391), -fill => $outline, -tags =>
['floor1', 'bg']);
$w->create('line', qw(0 337 0 391), -fill => $outline, -tags =>
['floor1', 'bg']);
$w->create('line', qw(60 391 0 391), -fill => $outline, -tags =>
['floor1', 'bg']);
$w->create('line', qw(3 114 3 337), -fill => $outline, -tags =>
['floor1', 'bg']);
$w->create('line', qw(258 387 60 387), -fill => $outline, -tags =>
['floor1', 'bg']);

Jack D

2006-08-21, 4:01 am

"jack london" <diavolo-verde@libero.it> wrote in message
news:1156037260.367050.26830@i42g2000cwa.googlegroups.com...
> Hello,
>
> I have an autocad map of my campsite and I would like to create a map
> similar to the one in floorplan widget demonstration. Are there tools
> to do this task? Or simply to help drawing the map and auto-convert
> into points and lines needed to draw a canvas?


Just a few from Google:

http://search.cpan.org/search?module=CAD::Drawing

which includes something to do with Tk:
http://search.cpan.org/~ewilhelm/CA...rawing/IO/Tk.pm
(I didn't check it out that closely)

http://wiki.tcl.tk/6577

--
Jack


filippo

2006-08-23, 6:58 pm

Jack D ha scritto:

> which includes something to do with Tk:
> http://search.cpan.org/~ewilhelm/CA...rawing/IO/Tk.pm
> (I didn't check it out that closely)
>
> http://wiki.tcl.tk/6577


thanks Jack,
this last seems the more promising to me. I have to translate it to
perl, not big effort.

Thanks,

Davide

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com