Re: [Therion] Is copying supposed to be done in reverse?

2022-06-20 Thread Tarquin Wilton-Jones via Therion
On 20/06/2022 10:19, Bruce Mutton wrote:
> Ha!  It was the great Tarquin who provided me with insight one year ago
> https://www.mail-archive.com/therion@speleo.sk/msg08109.html 

"I have no memory of this place" Gandalf

But yes, what I am seeing now conflicts with what I wrote then. So
something has changed, and I don't think it is for the better.
___
Therion mailing list
Therion@speleo.sk
https://mailman.speleo.sk/listinfo/therion


Re: [Therion] Is copying supposed to be done in reverse?

2022-06-20 Thread Tarquin Wilton-Jones via Therion
> As far as I am aware, the last called layout or statement always wins.
> Certainly since I started using the recipe I have not noticed any
> problems, and my layouts occasionally have conflicting parameters for a
> particular setting (which is why I originally had problems – I was not
> rigorous about call order).
> 
> Seems to conflict with your experience, maybe mine are simpler?

Affirmative, what I am seeing conflicts with the statement you made on
the wiki.

Your example seems not to have two "copied" layouts arguing with each
other. But the written text claims that what I am seeing is not what
should be happening. Thus I assume this is a bug. I would love to have a
more definitive "It is supposed to work like [blah]", so I know what bug
report to file though. It is fairly evident that having the "copy"
commands being executed in the specified order is best. However,
arguments could be made in both directions for whether statements before
a copy should override the copy.

> (I don’t see an endlayout for your layout third – could that be something)

There is one. Or at least, I can see it. o_O

Cheers,

Tarquin
___
Therion mailing list
Therion@speleo.sk
https://mailman.speleo.sk/listinfo/therion


Re: [Therion] Is copying supposed to be done in reverse?

2022-06-20 Thread Bruce Mutton
Ha!  It was the great Tarquin who provided me with insight one year ago
https://www.mail-archive.com/therion@speleo.sk/msg08109.html 

___
Therion mailing list
Therion@speleo.sk
https://mailman.speleo.sk/listinfo/therion


Re: [Therion] Is copying supposed to be done in reverse?

2022-06-20 Thread Bruce Mutton
Hi Tarquin

I have occasionally had unexpected behaviours due to conflicting layout
calls, and came up with the recipe here for hierarchy and order of calls
some time ago
https://therion.speleo.sk/wiki/bds#order_of_layout_functions_called 

 

As far as I am aware, the last called layout or statement always wins.
Certainly since I started using the recipe I have not noticed any problems,
and my layouts occasionally have conflicting parameters for a particular
setting (which is why I originally had problems - I was not rigorous about
call order).

 

Seems to conflict with your experience, maybe mine are simpler?

(I don't see an endlayout for your layout third - could that be something)

 

Bruce

___
Therion mailing list
Therion@speleo.sk
https://mailman.speleo.sk/listinfo/therion


[Therion] Is copying supposed to be done in reverse?

2022-06-20 Thread Tarquin Wilton-Jones via Therion
Hi folks,

I stumbled on something odd about the "copy" command, which is used in a
"layout". Normally, commands in a layout are interpreted in sequence, so
if you hide something with one command, then show it with a subsequent
command, it will use the second one, and show it:

symbol-hide point stalactite
symbol-show point stalactite #this one wins

If two copy commands copy conflicting information, the first one is
used, not the second. Assume the following .thconfig:

layout first
  symbol-hide point stalactite
  symbol-hide point water-flow
  symbol-hide point dig
  code metapost
let l_wall_bedrock = l_pit;
  endcode
endlayout
layout second
  symbol-show point stalactite
  code metapost
let l_wall_bedrock = l_wall_debris;
  endcode
endlayout
layout third
  symbol-show point water-flow #overrides the copy below
  copy first #first one wins with copy
  copy second
  symbol-show point dig #overrides the copy above
  symbol-hide point anchor
  symbol-show point anchor #second one wins normally
endlayout
source "copy.th"
select copyMP@copy
export map -proj plan -layout third -o "copy.pdf"

Use a basic survey with a default (bedrock) wall, stalactite, anchor,
water-flow. I would expect the wall to look like debris, the stalactite
to be visible, the anchor to be visible, the dig to be visible, and the
water-flow to be hidden. But instead, the wall looks like a pitch, the
stalactite is hidden (!), the anchor is visible, the dig is visible, and
the water-flow is visible (!).

It seems very inconsistent that the anchor and stalactite are visible at
the same time, because it means most commands are executed sequentially,
but copy commands are executed in reverse. It also seems inconsistent,
but understandable, that both the water-flow and dig are visible. My
understanding is therefore that:

* All copy commands get moved to the top of the layout that they are
inside, no matter where you put them in the layout. (Understandable but
weird.)
* Copy commands get executed in the opposite order from how they are
specified (inconsistent with other commands).

I couldn't find anything in the Therion book or wiki describing this, so
is it a bug or expected behaviour?

The book just says "copy  . set properties here that
are not modified based on the given source layout". That wording is
really minimal, but it seems to suggest that commands in "third" will
override anything in "first" and "second", which rather poorly explains
the first bullet point. It does not explain the second.

Therion 6.1.0, Windows 10.

Cheers,

Tarquin
___
Therion mailing list
Therion@speleo.sk
https://mailman.speleo.sk/listinfo/therion