2010年6月17日木曜日

イメージをテキストにテキストをイメージに。(3)


http://www.ted-cad.co.jp/
イメージをテキストにテキストをイメージに。(3)q090902
カラースポットのテキストデータ(A)を出力しました。テキストデータ(A)をテキストエディタで編集し、カラースポットを(B)のように数字に置き換えました。イメージは、(A)と(B)を変換して重ねたものです。
《学生の方に、[Grain CAD System]と[QuickLeaf]の製品版を無償で提供いたします!》

=======================================================
(A)カラースポットのテキストデータです。
 /Layer "Spot"
  .PenColor  1 Cyan
  .PenColor  2 Yellow
  .PenColor  6 Yellow
  .PenColor  9 Red
  .PenColor  10 DGreen
  .PenColor  13 DYellow
  .PenColor  14 DMazenda
  .PenColor  15 DWhite
  .Pen  13  0.0100 Round
  .Spot    0.4500   0.4100
  .Spot    0.4600   0.4100
  .Pen  15  0.0100 Round
  .Spot    0.4700   0.4100
  .Pen  13  0.0100 Round
  .Spot    0.4800   0.4100
  .Pen  15  0.0100 Round
  .Spot    0.4900   0.4100
  .Pen  13  0.0100 Round
  .Spot    0.5000   0.4100
  .Pen  2  0.0100 Round
  .Spot    0.5100   0.4100
  .Spot    0.5200   0.4100
  .Spot    0.5300   0.4100
  .Pen  13  0.0100 Round
  .Spot    0.5400   0.4100
  .Pen  2  0.0100 Round
  .Spot    0.5500   0.4100
  .Spot    0.5600   0.4100
  .Spot    0.5700   0.4100
=======================================================
(B)テキストエディタでカラースポットを数字("7")等に置き換えたテキストデータです。
 /Layer "Text"
  .PenColor  1 Black
  .PenColor  2 Black
  .PenColor  6 Black
  .PenColor  9 Black
  .PenColor  10 Black
  .PenColor  13 Black
  .PenColor  14 Black
  .PenColor  15 Black
  .Pen  13  0.0100 Round
  .Text    0.4475   0.4045 0.010000   0.0000
      "7"
  .Text    0.4575   0.4045 0.010000   0.0000
      "7"
  .Pen  15  0.0100 Round
  .Text    0.4675   0.4045 0.010000   0.0000
      "9"
  .Pen  13  0.0100 Round
  .Text    0.4775   0.4045 0.010000   0.0000
      "7"
  .Pen  15  0.0100 Round
  .Text    0.4875   0.4045 0.010000   0.0000
      "9"
  .Pen  13  0.0100 Round
  .Text    0.4975   0.4045 0.010000   0.0000
      "7"
  .Pen  2  0.0100 Round
  .Text    0.5075   0.4045 0.010000   0.0000
      "1"
  .Text    0.5175   0.4045 0.010000   0.0000
      "1"
  .Text    0.5275   0.4045 0.010000   0.0000
      "1"
  .Pen  13  0.0100 Round
  .Text    0.5375   0.4045 0.010000   0.0000
      "7"
=======================================================

フォーマットは次の通りです。
「層データ」
 /Layer [layer_name]
   layer_name 文字列の規約に従う層名称 省略時可能
「ペン色指定」
  .PenColor pen_number color_name
    pen_number ペン番号(1~1024)
    color_name 色名称
「ペン指定」
  .Pen pen_number pen_size shape
    pen_number ペン番号(1~1024)
    pen_size  ペンサイズ
    shape   Round または Square
「図形 スポット」
  .Spot x y
      x y 位置
「図形 文字列」
  .Text x y height angle
    string
      x y  文字列の開始位置
      height 文字高さ
      angle 角度(単位=度)
      string .Text 512バイト以内の文字列を指定

0 件のコメント:

コメントを投稿