From 21931e0b497d6d49eefeeeac2d8868bd604676ad Mon Sep 17 00:00:00 2001 From: Aada Date: Thu, 20 Jun 2024 13:35:01 +0200 Subject: Add more anchors --- shape.tex | 10 +++++++++- shapes.tex | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/shape.tex b/shape.tex index def5008..bcd3b0c 100644 --- a/shape.tex +++ b/shape.tex @@ -23,12 +23,14 @@ \node[stop2, name=two, below=4.5cm of one.west, anchor=west] {}; \node[stop3, name=three, below=4.5cm of two.west, anchor=west] {}; \node[stop4, name=four, below=4.5cm of three.west, anchor=west] {}; + \node[stop5, name=five, below=4.5cm of four.west, anchor=west] {}; + \node[stop6, name=six, below=4.5cm of five.west, anchor=west] {}; \draw[gray, thin] (one.center) -- (two.one half) -- (three.one half) -- (four.one half) (two.two half) -- (three.center) -- (four.two quarter) (three.two half) -- (four.three quarter) ; - \foreach\shape in {one,two,three,four} { + \foreach\shape in {one,two,three,four,five,six} { \foreach\anchor/\placement in {% % Custom anchors one half/below, @@ -43,6 +45,12 @@ north two half/right, north two quarter/above left, north three quarter/above right, + three sixth/above, + north three sixth/above, + south three sixth/below, + four sixth/above, + north four sixth/above, + south four sixth/below, % Standard anchors south/below, north/above, diff --git a/shapes.tex b/shapes.tex index 1471807..1f57d35 100644 --- a/shapes.tex +++ b/shapes.tex @@ -120,6 +120,45 @@ \pgf@y=-\pgf@y } + \savedanchor{\outerthirdsixth}{ + \setlength{\pgf@xa}{\pgfshapeminwidth} + \setlength{\pgf@ya}{\pgfshapeminheight} + \pgf@y=\pgf@ya + \pgf@x=-.5\pgf@xa % We are at (shape.north west) now + % \multiply\pgf@ya by 2 + \advance\pgf@x by 2.5\pgf@ya % We are at (shape.north one half) now + } + + \anchor{three sixth}{ + \outerthirdsixth + \pgf@y=0pt + } + + \anchor{four sixth}{ + \outerthirdsixth + \pgf@x=-\pgf@x + \pgf@y=0pt + } + + \anchor{north three sixth}{ + \outerthirdsixth + } + + \anchor{south three sixth}{ + \outerthirdsixth + \pgf@y=-\pgf@y + } + + \anchor{north four sixth}{ + \outerthirdsixth + \pgf@x=-\pgf@x + } + + \anchor{south four sixth}{ + \outerthirdsixth + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } \savedanchor{\outertop}{ \setlength{\pgf@ya}{\pgfshapeminheight} @@ -168,4 +207,12 @@ stop, minimum width=8cm, }, + stop5/.style={ + stop, + minimum width=10cm, + }, + stop6/.style={ + stop, + minimum width=12cm, + }, } -- cgit v1.2.3