PostScript中的复制命令 [英] Copy command in PostScript

查看:144
本文介绍了PostScript中的复制命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过以下链接阅读RobertSedwick的算法

I am reading algorithms by RobertSedwick at following link

http://books.google.co.in/books?id=pQRLfMngZ7sC&pg=PA213&lpg=PA213&dq=塔楼+的+ hanoi + relation + with + trailing + zeros& source = bl& ots = gfM2UdBkNq& sig = avk5lNz7XeNODghvOlvHKSGMc8g& hl = zh-CN#v = onepage& q = towers%20of%20haniling%&%= 20 %% relation%20with false

页码:218图5.13

Page number: 218 Fig 5.13

以下语句在PostScript中意味着什么。

What does following statement mean in PostScript.

 2 copy ge {dup 0 rlineto}
 {
    ...
 } ifelse

还有以下含义

   2 copy KochR

我是第一次在这里研究PostScript。

I am looking into PostScript first time here.

推荐答案

请在此处查看Kurt Pfeifle的答案这个草率答案的版本。希望我已经在后续问题

Please see Kurt Pfeifle's answer here for a corrected version of this hasty answer. Hopefully, I've somewhat redeemed myself in the followup question

要直接回答您的问题,由于代码不完整,很难解释代码的作用。

To answer your question more directly, it's difficult to explain what the code does because it isn't complete.

两个代码段的开头都是 2个副本,这将堆栈中前两个内容的副本推入副本。这些是什么? ??!

The start of both snippets is 2 copy which pushes duplicates of the top two things on the stack. What are these things? ??!

嗯,它们可能是数字。在第一个示例中,它们几乎绝对是坐标对:x和y。如果y大于2,则画一条线到(current-x + y-from-stack,0)。为什么这样??!

Well, they're probably numbers. In the first example, they're almost definitely a coordinate pair: x and y. If y is greater than 2, then draw a line to (current-x + y-from-stack, 0). Why do this? ??!

在第二个示例中, KochR 最有可能是递归过程来绘制科赫曲线,其中参数几乎肯定是递归级别,另一个可能是单个行段的长度(除非它确实很复杂并且提供全局缩放控件)。

In the second example, KochR is most likely a recursive procedure to draw a Koch curve where one of the parameters is almost certainly the recursion level, and the other is probably the length of a single line-segment (unless it's really sophisticated and offers a global-scaling control).

这就是从所示代码中可以猜测到的所有内容。 HTH。

That's about all that can be guessed from the code as shown. HTH.

这篇关于PostScript中的复制命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆