abs P X Y A
Defines loc P given coordinates (distances) and absolute bearing
- rel F T L R A
+ rel F T [L R A]
Defines loc T: start at loc F, go forward L, translate right R,
- turn left A.
+ turn left A (defaults are all 0).
extend F T len L [R] length L
extend F T upto U [R] s.t. perpendicular at T passes through U
(`formal parameter', F must be just <identifier>) is placed at
existing loc A (`actual parameter'). If prefix P (syntax is that of
an identifier) is specified, each other loc L inside O is exported
- into the global namespace as a new loc PL. If `flip' is used then
- the object is placed with object-space y coordinates negated (ie, it
- is mirrored so that the object's North exchanges with South).
+ into the global namespace as a new loc PL. P may be `=' to indicate
+ an empty prefix (default is not to export locs). If `flip' is used
+ then the object is placed with object-space y coordinates negated
+ (ie, it is mirrored so that the object's North exchanges with
+ South).
my ($from,$to,$len,$right,$turn);
$from= can(\&cva_idex);
$to= can(\&cva_idnew);
- $len= can(\&cva_len);
- $right= can(\&cva_len);
- $turn= cano(\&cva_absang, 0);
+ $len= cano(\&cva_len,0);
+ $right= cano(\&cva_len,0) * $ctx->{Trans}{R};
+ $turn= cano(\&cva_ang, 0) * $ctx->{Trans}{R};
my ($u)= ev_compose({}, $from, { X => $len, Y => -$right, A => 0 });
ev_compose($to, $u, { X => 0, Y => 0, A => $turn });
}
$ctx->{Trans}{X}= $actual->{X} - $formcv->{X};
$ctx->{Trans}{Y}= $actual->{Y} - $formcv->{Y};
$ctx->{InRunObj}= $ctx_save->{InRunObj}."${obj_id}::";
+ $ctx->{Draw}{T}= $ctx_save->{Draw}{T};
+ $ctx->{Draw}{L}= $ctx_save->{Draw}{L};
$ctx->{Draw}{L} =~ s/L//;
dv("cmd__obj $obj_id ",'$ctx',$ctx);
{
cmd__one();
}
};
- $pfx= cano(\&cva_idstr,'');
+ if (@al && $al[0] eq '=') {
+ $pfx= ''; shift @al;
+ } else {
+ $pfx= cano(\&cva_idstr,undef);
+ }
$ctx_inobj= $ctx;
$ctx= $ctx_save;
- if (length $pfx) {
+ if (defined $pfx) {
foreach $id (keys %{ $ctx_inobj->{Loc} }) {
next if $id eq $formal_id;
$newid= $pfx.$id;