Open ccaprani opened 4 years ago
I've been thinking a bit more on this.
Something I should have made clearer is that it is not only for line thicknesses but also for other decorations like force arrow head types. Again, use of scope on a pic
would globally affect all force definitions, whereas some may like certain styles for (say) moments, and another style for linear forces.
Solution (2) I mentioned may not be so bad actually as it may not need tikzset
s for each command option. Instead there may be a single dbeam_line
with presets for the usual command options, but which can be overridden if desired. Further, it would not be every draw element that would need such flexibility - maybe just beam lines and forces? I can't see a use-case for needing to define different styles for draw elements of a support for example.
So in summary, perhaps all that is needed is:
\tikzset{dbeam_line/.style ...}
\tikzset{force_line/.style ...}
\tikzset{moment_line/.style ...}
Happy to give this a shot if you think it's on the right track?
Hi Jurgen - really love this package - well done! I have forked it and am willing to do some development on the issue below, but thought I'd see what you think is a good approach first.
Problem A typical use case is to present the same structure multiple times as a basis for some other plots; e.g. BMD, SFD, deflected shape, etc. Repeating the structure drawing code makes no sense, and so using a
\tikzset
andpic
is really useful. Using this approach, styles can be altered as needed usingscope
s as suggested in the package documentation:One issue I have found is that line thicknesses cannot be changed using this approach. This is because the library defines line thickness as follows:
where
\DhugeLineWidth
isas a result, including
line width
in argument#2
of mypic
above has no effect.The problem can be solved by doing the following:
but this requires the user to access the undocumented innards of the library (i.e.
hugeLine
in this case), and it may change the line width on elements other than those expected (whereverhugeLine
is used to draw elements in the scope.Question So my question is: what is the best way to adapt the library code to allow for line thickness specifications?
Solutions? In a bid to be helpful, I'm wondering if the solution is something like:
command
s definitions to include the option of overriding line widths;tikzset
stylesI don't like (1) because it means editing all the library commands (lots of work); it also means more complex commands (additional argument); and it is inconsistent
tikz
design which should be all updateable through/.style
appends orscope
(which I prefer for simplicity).I don't like (2) because it would mean introducing
tikz
styles for every type of element drawn, e.g.bending beam
,truss rod
,invisible
just to name the ones possible for\dbeam
.On balance I think (2) is easier for both normal and advanced users. Is there a third (and better) solution?
Thanks!