Are you looking to change all line slopes to the same value in your therion files?
If so, then the best workaround may be to play around with the metapost in your thconfig files.
I will explain this in 4 sections: 1 how to find the metapost code, 2. where this goes in your thconfig file 3. the exact code to put into the layout of your thconfig file and 4. how to adjust this specific metapost code to get your desired results (whilst ignoring the l-size 40)
but I use the method where you just put -d in the "command line options" box of the .thconfig window:
this makes one folders in your computer (thTMPDIR) with files inside only one is useful to us right now: "
data.mp"
in this file is all the "metapost" our computers looks for when processing your therion files, two items cover your line slope.
def l_slope_SKBB (expr P,S)(text Q) =
def l_slope_BCRA (expr P,S)(text Q) =
SKBB is therions default code, over here in the UK we force it to use our own symbols "BCRA" by using "symbol-set BCRA" in our layout file of the thconfig.
2. where this goes in your thconfig file
so if you wish to modify Therions native line slope code, then you need everything between "def l_slope_SKBB" and the "enddef;" from the
data.mp file
if you place the below code at the end of the layout file you are using then it should pick it up and know that you want to use the new symbol. (NCOOKE can be replaced with any word you wish, but most people stick to words like TEST or GOTT or something memorable to you (in my case surname).
Unfortunately this did not work for me, so I needed to work around by also inserting the following two commands prior to the exact code (3) below:
this is because the BCRA symbol set seemed to be 'sticky' for this particular symbol
3. the exact code to put into the layout of your thconfig file
#########
symbol-assign line slope NCOOKE
code metapost
initsymbol ("l_slope_NCOOKE");
def l_slope_NCOOKE (expr P,S)(text Q) =
%show Q;
T:=identity;
numeric dirs[];
numeric lengths[];
for i=1Q: % AG20240312 change number prior to Q the higher the number the larger the line
dirs[redpart i]:=greenpart i;
lengths[redpart i]:=bluepart i;
endfor;
li:=length(P); % last
alw_perpendicular:=true;
for i=0 upto li:
if unknown dirs[i]: dirs[i]:=-1;
else:
if dirs[i]>-1:
dirs[i]:=((90-dirs[i]) - angle(thdir(P,i))) mod 360;
alw_perpendicular:=false;
fi;
fi;
if unknown lengths[i]: lengths[i]:=-1; fi;
endfor;
%for i=0 upto li: show dirs[i]; endfor;
ni:=0; % next
pi:=0; % previous
for i=0 upto li:
d:=dirs[i];
if d=-1:
if (i=0) or (i=li):
dirs[i] := angle(thdir(P,i) rotated 90) mod 360;
pi:=i;
else:
if ni<=i:
for j=i upto li:
ni:=j;
exitif dirs[j]>-1;
endfor;
fi;
w:=arclength(subpath(pi,i) of P) /
arclength(subpath(pi,ni) of P);
dirs[i]:=w[dirs[pi],dirs[ni]];
% if (dirs[i]-angle(thdir(P,i))) mod 360>180:
% dirs[i]:=w[dirs[ni],dirs[pi]];
% message("*******");
% fi;
fi;
else:
pi:=i;
fi;
endfor;
%for i=0 upto li: show dirs[i]; endfor;
ni:=0; % next
pi:=0; % previous
for i=0 upto li:
l:=lengths[i];
if l=-1:
if (i=0) or (i=li):
lengths[i] := 1cm; % should never happen!
thwarning("slope width at the end point not specified");
pi:=i;
else:
if ni<=i:
for j=i+1 upto li:
ni:=j;
exitif lengths[j]>-1;
endfor;
fi;
w:=arclength(subpath(pi,i) of P) /
arclength(subpath(pi,ni) of P);
lengths[i]:=w[lengths[pi],lengths[ni]];
pi:=i;
fi;
else:
pi:=i;
fi;
endfor;
% for i=0 upto li: show lengths[i]; endfor;
T:=identity;
boolean par;
offset:=0;
dlzka := (arclength P);
if dlzka>3u:
offset := 0.3u;
elseif dlzka>u:
offset := 0.1u; %AG20240312 moves the start of the symbol away from the line end
fi;
dlzka:=dlzka-2offset;
cas := offset;
mojkrok:=adjust_step(dlzka,1.4u) / 2; %AG20240312 adjusting the number after the forward slash increases the frequency of lines
pickup PenD;
par := false;
forever:
t := arctime cas of P;
if t mod 1>0: % not a key point
w := (arclength(subpath(floor t,t) of P) /
arclength(subpath(floor t,ceiling t) of P));
if alw_perpendicular:
a := 90;
else:
a := w[dirs[floor t],dirs[ceiling t]];
fi;
l := w[lengths[floor t],lengths[ceiling t]];
else:
if alw_perpendicular:
a := 90;
else:
a:= dirs[t];
fi;
l:=lengths[t];
fi;
a := a + angle(thdir(P,t));
thdraw (point t of P) --
((point t of P) + if par: 0.333 * fi l * unitvector(dir(a)));
cas := cas + mojkrok;
par := not par;
exitif cas > dlzka + offset + 0.1mm; % for rounding errors
endfor;
if S = 1: pickup PenC; draw P fi;
%pickup pencircle scaled 3pt;
%for i=0 upto li: draw point i of P; endfor;
enddef;
endcode
#######
4. how to adjust the metapost code to get your desired results (whilst ignoring the l-size 40)
I have worked out which 3 of the above lines provide some movement to the line slope hairs, and I have noted them with my initials and todays date AG20240312
for i=1Q: % AG20240312 change number prior to Q the higher the number the larger the line
As stated in the description - by increasing the number 1 you can increase the length of hairs coming out of the line slope.
offset := 0.1u; %AG20240312 moves the start of the symbol away from the line end
largely useless for your query, but I worked out what it did, so I didn't really want to throw this knowledge away. I think where I have written, "line end" I meant line start. but it does also squish the hair together.
mojkrok:=adjust_step(dlzka,1.4u) / 2; %AG20240312 adjusting the number after the forward slash increases the frequency of lines
The number two(2) is the important thing to change, by increasing or decreasing this figure it increases or decreases the frequency of lines decimals can also be used, such as .5 instead of 2 (ie 4 times less frequent)
Sent from my iPhone
Hi Marco,