Message Boards Message Boards

0
|
5698 Views
|
7 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Continuous line drawing error?

Posted 10 years ago

I am trying to emulate the representation of Leonardo da Vinci’s Mona Lisa as a continuous-line drawing at Enhanced graphs and Networks When I attempt it with an image of my own, it gives me an error on the last line;

 Graphics[Line[pos[[res[[2]]]]]]

Part::partd: "Part specification res[[2]] is longer than depth of object. \!

It seems res has gone missing, how do I fix this?

Attachments:
POSTED BY: Stuart Anderson
7 Replies
Posted 10 years ago

10 months later, I tried again, (i think my version of Mathematica is updated) and it worked, no problems!

POSTED BY: Stuart Anderson

Did your kernel crash? The thing is that the error message says that res[[2]] does not exist. So it either has never been calculated or it was deleted. The latter could happen if the kernel died on you, say because it ran out of memory or so.

Cheers,

Marco

POSTED BY: Marco Thiel
Posted 10 years ago

My understanding of the error is that res is the list of shortest path points. res[[2]] should access points from the list, as this is the same as the Part command, perhaps res is going out of scope when it shouldnt. Why this happens to me, and not to others I have no idea.

I am using Linux Ubuntu 14.04. I'll try the Wolfram Programming Cloud.

I tried again with a different image (I used Jorge Luis Borges image), in Mathematica it failed again at the last command, res[[2]] error again. This time it didnt work in CDF Player either, same res[[2]] error

POSTED BY: Stuart Anderson

That is strange indeed. The error seems to say that the array res is not what we expect it to be. Have you had a look at that variable?

Dimensions[res]

On which operating system are you? I have tried this on a number of Macs and it works alright. I just tried in in the Wolfram Programming Cloud and int works fine, too. Perhaps you can make a free Wolfram Programming Cloud account and check whether it works for you there?

I have resized the image programatically using:

ImageResize[stuart, {200,266}]

Cheers,

Marco

POSTED BY: Marco Thiel
Posted 10 years ago

It's not the Grayscale command. If I open the notebook in CDF (Player 9) it loads quickly, and produces the final tour image. However if I open it in Mathematica, and try to evaluate the notebook (it doesn't matter if I evaluate line by line, or the whole notebook at once), it always gives the same error on the last line.

POSTED BY: Stuart Anderson
Posted 10 years ago

Thanks,

That's odd. I wrote Graysscale, it reverted to grayscale. I changed it back again to Grayscale and it reverted to grayscale again. Perhaps i wasn't saving the notebook properly?

Thanks, Stuart

POSTED BY: Stuart Anderson

Hi Stuart,

I have changed grayscale to Grayscale and it seems to work.

enter image description here

The notebook is attached.

Cheers,

Marco

Attachments:
POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract