How to avoid that symbol-colour area blocks fills the blocks with chosen color
Hi! I would like to color sand, pebbles, blocks and other sediments as brown. I use Symbol-colour to this, like symbol-colour point pebbles [67 31 4] symbol-colour point blocks [67 31 4] It works fine. In some passages I have defined areas with pebbles and areas with blocks, so I use these as well: symbol-colour area pebbles [67 31 4] symbol-colour area blocks [67 31 4] It works fine for pebbles. But on the PDF map the area blocks get filled with the brown color. The result is that some blocks on the PDF-map are brown filled with no color and other blocks are brown and filled with the brown color. The attachment illustrates it. How can I get use "area blocks" to behave like other sediments when I want colors (and no filling)? Torstein Finnesand
How can I get use "area blocks" to behave like other sediments when I want colors (and no filling)?
Torstein You will need to either choose a predefined 'area blocks' that does not have a solid fill from the standards available - currently AUT and SKBB are the only unique ones I think - and quite possibly they are both filled. Or you will need to modify the existing definitions. I have no time to check just now, but you might like to have a look at what I did here http://therion.speleo.sk/wiki/doku.php/examples (Sample dataset at the top of the page) and modify it a bit to see how it behaves with colour assignments. Bruce
You just need to remove filling from symbol definition. In your layout, try to use for example this code: code metapost def a_blocks (expr p) = T:=identity; pickup PenC; path q, qq; q = bbox p; picture tmp_pic; uu := max(u, (xpart urcorner q - xpart llcorner q)/100, (ypart urcorner q - ypart llcorner q)/100); tmp_pic := image( for i = xpart llcorner q step 2uu until xpart urcorner q: for j = ypart llcorner q step 2uu until ypart urcorner q: qq := punked (((-.5uu,-.5uu)--(.5uu,-.5uu)--(.5uu,.5uu)--(-.5uu,.5uu)--cycle) randomized (uu/2)) rotated uniformdeviate(360) shifted ((i,j) randomized 1.6uu); if xpart (p intersectiontimes qq) < 0: thdraw qq; fi; endfor; endfor; ); clip tmp_pic to p; draw tmp_pic; enddef; This is modified a_blocks_SKBB definition with "thclean qq;" statement removed. S. On 4 November 2012 19:37, Bruce <bruce@tomo.co.nz> wrote:
How can I get use "area blocks" to behave like other sediments when I want colors (and no filling)?
Torstein
You will need to either choose a predefined 'area blocks' that does not have a solid fill from the standards available - currently AUT and SKBB are the only unique ones I think - and quite possibly they are both filled.
Or you will need to modify the existing definitions.
I have no time to check just now, but you might like to have a look at what I did here http://therion.speleo.sk/wiki/doku.php/examples (Sample dataset at the top of the page) and modify it a bit to see how it behaves with colour assignments.
Bruce
_______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
Another solution is to leave "thclean qq" on its original position and change clip tmp_pic to p; draw tmp_pic; to clip tmp_pic to p; drawoptions(); draw tmp_pic; at the end of the macro definition. This approach preserves filling the blocks with a background colour. I think all built-in symbols should be updated in this way. Martin On Mon, Nov 5, 2012 at 2:20 PM, Stacho Mudrak <lists@group-s.sk> wrote:
You just need to remove filling from symbol definition.
In your layout, try to use for example this code:
code metapost def a_blocks (expr p) = T:=identity; pickup PenC; path q, qq; q = bbox p; picture tmp_pic; uu := max(u, (xpart urcorner q - xpart llcorner q)/100, (ypart urcorner q - ypart llcorner q)/100); tmp_pic := image( for i = xpart llcorner q step 2uu until xpart urcorner q: for j = ypart llcorner q step 2uu until ypart urcorner q: qq := punked (((-.5uu,-.5uu)--(.5uu,-.5uu)--(.5uu,.5uu)--(-.5uu,.5uu)--cycle) randomized (uu/2)) rotated uniformdeviate(360) shifted ((i,j) randomized 1.6uu); if xpart (p intersectiontimes qq) < 0: thdraw qq; fi; endfor; endfor; ); clip tmp_pic to p; draw tmp_pic; enddef;
This is modified a_blocks_SKBB definition with "thclean qq;" statement removed.
S.
On 4 November 2012 19:37, Bruce <bruce@tomo.co.nz> wrote:
How can I get use "area blocks" to behave like other sediments when I want colors (and no filling)?
Torstein
You will need to either choose a predefined 'area blocks' that does not have a solid fill from the standards available - currently AUT and SKBB are the only unique ones I think - and quite possibly they are both filled.
Or you will need to modify the existing definitions.
I have no time to check just now, but you might like to have a look at what I did here http://therion.speleo.sk/wiki/doku.php/examples (Sample dataset at the top of the page) and modify it a bit to see how it behaves with colour assignments.
Bruce
_______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
_______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
Oh to be proficient in metapost! Martin, that may be the tip I have been looking for. I will experiment with this sometime. It also depends on how various pdf readers and printer drivers interpret the different approaches. I presume your recommendation applies to areas defined using drawing/clipping to the path, and not areas defined using patterns? And is it better to use drawoptions(); or thdrawoptions(); ? Bruce -----Original Message----- From: therion-bounces@speleo.sk [mailto:therion-bounces@speleo.sk] On Behalf Of Martin Budaj Sent: Tuesday, 6 November 2012 6:39 a.m. To: List for Therion users Subject: Re: [Therion] How to avoid that symbol-colour area blocks fills the blocks with chosen color Another solution is to leave "thclean qq" on its original position and change clip tmp_pic to p; draw tmp_pic; to clip tmp_pic to p; drawoptions(); draw tmp_pic; at the end of the macro definition. This approach preserves filling the blocks with a background colour. I think all built-in symbols should be updated in this way. Martin
On Mon, Nov 5, 2012 at 8:33 PM, Bruce <bruce@tomo.co.nz> wrote:
Martin, that may be the tip I have been looking for. I will experiment with this sometime. It also depends on how various pdf readers and printer drivers interpret the different approaches.
Besides Adobe Reader I get the best results using poppler-based viewers, like Evince (especially regarding the rendering of transparency groups).
I presume your recommendation applies to areas defined using drawing/clipping to the path, and not areas defined using patterns?
Exactly. The drawoptions were applied twice by MetaPost: * first time when drawing a symbol (e.g. block) to a temporary picture -- this time the "thclean qq" command overrides the default fill color (set by drawoptions) and fills the block area with a (transparent) color of scrap background * second time when this picture was (after clipping) added to other symbol drawings -- in this case MetaPost applies the default color to all lines (block border) and areas (interior of a block) drawn in the temporary picture.
And is it better to use drawoptions(); or thdrawoptions(); ?
They are used independently, but if you set the same option (like color) using both of them, drawoptions has a higher priority. Currently therion uses drawoptions to specify symbol colors and thdrawoptions are used in symbol definitions to specify dashed lines. Martin
And is it better to use drawoptions(); or thdrawoptions(); ?
They are used independently, but if you set the same option (like color) using both of them, drawoptions has a higher priority. Currently therion uses drawoptions to specify symbol colors and thdrawoptions are used in symbol definitions to specify dashed lines.
As you indicated the first time Martin B, after experimenting it seems it is indeed best with thclean qq; left in place, and with drawoptions(); Thanks, I will add this to my custom NZSS symbol set and submit them to add the ones Martin S kindly added with the previous update. Bruce
Thanks, that solved my problem. Thanks to the contributions from Bruce and Martin as well. Torstein On 05.11.2012 14:20, Stacho Mudrak wrote:
You just need to remove filling from symbol definition.
In your layout, try to use for example this code:
code metapost def a_blocks (expr p) = T:=identity; pickup PenC; path q, qq; q = bbox p; picture tmp_pic; uu := max(u, (xpart urcorner q - xpart llcorner q)/100, (ypart urcorner q - ypart llcorner q)/100); tmp_pic := image( for i = xpart llcorner q step 2uu until xpart urcorner q: for j = ypart llcorner q step 2uu until ypart urcorner q: qq := punked (((-.5uu,-.5uu)--(.5uu,-.5uu)--(.5uu,.5uu)--(-.5uu,.5uu)--cycle) randomized (uu/2)) rotated uniformdeviate(360) shifted ((i,j) randomized 1.6uu); if xpart (p intersectiontimes qq) < 0: thdraw qq; fi; endfor; endfor; ); clip tmp_pic to p; draw tmp_pic; enddef;
This is modified a_blocks_SKBB definition with "thclean qq;" statement removed.
S.
On 4 November 2012 19:37, Bruce <bruce@tomo.co.nz <mailto:bruce@tomo.co.nz>> wrote:
> How can I get use "area blocks" to behave like other sediments when I want colors (and no filling)?
Torstein
You will need to either choose a predefined 'area blocks' that does not have a solid fill from the standards available - currently AUT and SKBB are the only unique ones I think - and quite possibly they are both filled.
Or you will need to modify the existing definitions.
I have no time to check just now, but you might like to have a look at what I did here http://therion.speleo.sk/wiki/doku.php/examples (Sample dataset at the top of the page) and modify it a bit to see how it behaves with colour assignments.
Bruce
_______________________________________________ Therion mailing list Therion@speleo.sk <mailto:Therion@speleo.sk> http://mailman.speleo.sk/mailman/listinfo/therion
_______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
participants (4)
-
Bruce -
Martin Budaj -
Stacho Mudrak -
Torstein Finnesand