From c634fd4c36af1c69f61dbcd07c1d536316edfed3 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 11 Mar 2005 20:51:29 +0000 Subject: [PATCH] include segmentpart comments in output --- layout/informat.txt | 5 +++++ layout/layout | 36 ++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/layout/informat.txt b/layout/informat.txt index c099544..f15a658 100644 --- a/layout/informat.txt +++ b/layout/informat.txt @@ -294,6 +294,11 @@ Special comments in PostScript: %L bbox no locs, no bbox there were no locs, so there is no bounding box usu because input file was just obj defns and showlibrary + %L segmentpart KL D [-]S X0 Y0 A0 X1 Y1 A1 + records that a piece of subsegment S is drawn in the subsegment + encoding. The piece is of length D, in layer KL (which may be + the empty string, depending on layer configurations), and runs + from the loc X0,Y0,A0 to X1,Y1,A1. Scope S is O! when defining object or part O diff --git a/layout/layout b/layout/layout index 9e03827..bf042dd 100755 --- a/layout/layout +++ b/layout/layout @@ -626,27 +626,14 @@ sub parametric__o_pt ($) { our $segused_incurrent; our $segused_currentpt; -sub segment_used_begin ($) { - $segused_incurrent= 0; - $segused_currentpt= $_[0]; -} -sub segment_used_middle ($$) { - my ($used,$pt) = @_: - segment_used__len($used,$pt); -} -sub segment_used_end ($$) { - my ($used,$pt) = @_: - segment_used__len($used,$pt); - segment_used__print(); -} sub segment_used__print ($) { my ($pt) = @_; if ($segused_incurrent > 0) { o("%L segmentpart ". - $ctx->{Layer}{Level}.$ctx->{Layer}{Kind}." ".$segments[0]." ". + $ctx->{Layer}{Level}.$ctx->{Layer}{Kind}." ". + $segused_incurrent." ".$segments[0]." ". loc2dbg($segused_currentpt)." ". - log2dbg($pt)." ". - $segused_incurrent); + loc2dbg($pt)); } $segused_incurrent= undef; $segused_currentpt= undef; @@ -660,13 +647,26 @@ sub segment_used__len ($$) { $segments[1] -= $used; return if $segments[1] > 0; - segment_used__print(); + segment_used__print($pt); segment_used_begin($pt); @segments= @segments[2..$#segments]; o("% segments @segments\n"); } +sub segment_used_begin ($) { + $segused_incurrent= 0; + $segused_currentpt= $_[0]; +} +sub segment_used_middle ($$) { + my ($used,$pt) = @_; + segment_used__len($used,$pt); +} +sub segment_used_end ($$) { + my ($used,$pt) = @_; + segment_used__len($used,$pt); + segment_used__print($pt); +} sub parametric_segment ($$$$$) { my ($p0,$p1,$lenperp,$minradius,$calcfn) = @_; # makes $p (global) go from $p0 to $p1 ($p1>$p0) @@ -686,7 +686,7 @@ sub parametric_segment ($$$$$) { print DEBUG "ps $p0 $p1 $lenperp ($ppu)\n"; $draw= current_draw(); if ($draw =~ m/G/) { - my ($pt,$going,$red,$csegbare,$movfeat,$movstroke); + my ($pt,$going,$red,$csegbare,$movfeat,$movstroke,$used_last); $going=0; o("% segments @segments\n"); o(" $psu_subseglw setlinewidth\n"); -- 2.30.2