can you post the svg for this?
Step 1:
retrieve PVectors from a SVG and display every 22nd PVector as a letter “a”
I used a free shape https://freesvg.org/tocantins-region-vector-map-drawing
It’s a bit tricky since it contains a child and a sub-child and only then the vertices
// https://processing.org/tutorials/pshape
// https://freesvg.org/tocantins-region-vector-map-drawing
PShape svg;
void setup() {
size(940, 1360, P2D);
svg = loadShape("map_of_Tocantins.svg");
println(svg.getVertexCount());
println(svg.getChildCount());
PShape svg2 = svg.getChild(0); // id on svg file
println(svg2.getChildCount());
PShape svg3 = svg2.getChild(0); // id on svg file
println(svg3.getVertexCount());
for (int i = 0; i < svg3.getVertexCount(); i++) {
PVector v = svg3.getVertex(i);
v.x += random(-1, 1);
v.y += random(-1, 1);
// ellipse(v.x, v.y, 12, 12);
if (i%22==0) {
text ("a", v.x, v.y);
// svg2.setVertex(i,v.x,v.y);
}
}
}
void draw() {
// background(255);
// shape(svg);
}
//
Step 2
unsuccessfully attempting to rotate the individual letter so that is perpendicular to the line
// https://processing.org/tutorials/pshape
// https://freesvg.org/tocantins-region-vector-map-drawing
PShape svg;
String myText="The sketch has been resized from 940?1360 to 940?1061 by the window manager.";
float prevX=-1100, prevY;
void setup() {
size(940, 1060, P2D);
svg = loadShape("map_of_Tocantins.svg");
println(svg.getVertexCount());
println(svg.getChildCount());
PShape svg2 = svg.getChild(0); // id on svg file
println(svg2.getChildCount());
PShape svg3 = svg2.getChild(0); // id on svg file
println(svg3.getVertexCount());
translate(300, 0);
int k=0;
for (int i = 0; i < svg3.getVertexCount(); i++) {
PVector v = svg3.getVertex(i);
float angle=0 ;
//v.x += random(-1, 1);
//v.y += random(-1, 1);
if (k==0)
ellipse(v.x-19, v.y, 12, 12);
if (i%22==0) {
if (prevX!=-1100) {
PVector prev = new PVector(prevX, prevY);
angle = 20*PVector.angleBetween(v, prev);
angle += TWO_PI / 4.0;
print(angle, " ");
}//if
pushMatrix();
translate( v.x, v.y);
rotate(angle);
text (myText.charAt(k%myText.length()), 0, 0);
popMatrix();
k++;
}//if
if (i%50==0) {
prevX=v.x;
prevY=v.y;
}
}//for
}//func
void draw() {
// background(255);
// shape(svg);
}
//