# Get Vertex Count

**URL:** https://discourse.processing.org/t/get-vertex-count/45200
**Category:** Beginners
**Created:** [October 18, 2024, 7:06pm UTC](https://discourse.processing.org/t/get-vertex-count/45200 "2024-10-18T19:06:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![paulstgeorge](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)
#### Post date: [October 18, 2024, 7:06pm UTC](https://discourse.processing.org/t/get-vertex-count/45200/1 "2024-10-18T19:06:04Z")

</div>

I am trying to use the ‘ShapeVertices’ example in Processing 4.3 (Java mode).

The example works fine for the given “uk.svg”. When I try to use my own \*.svg instead of “uk.svg”, I get the error: ‘getVertexCount() only works with PATH or GEOMETRY shapes’.

What am I doing wrong/not doing?

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [October 19, 2024, 8:04am UTC](https://discourse.processing.org/t/get-vertex-count/45200/2 "2024-10-19T08:04:03Z")

</div>

If your svg opens in a graphic editor then you aren’t doing anything wrong it is possible your svg uses features not enabled / available / supported  
in Processing

---

<div class="post-metadata">

### Author: ![mrbbp](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mrbbp/32/15313_2.png) [@mrbbp](https://discourse.processing.org/u/mrbbp)
#### Post date: [October 19, 2024, 12:23pm UTC](https://discourse.processing.org/t/get-vertex-count/45200/3 "2024-10-19T12:23:32Z")

</div>

If you use an svg exported from Illustrator, you should optimized it with an online svg optimizer (there is more than one online)

some graphic software have some prob with the svg quality produced…  
or you can open and save with inkscape app.

hope this help

---

<div class="post-metadata">

### Author: ![paulstgeorge](https://avatars.discourse-cdn.com/v4/letter/p/53a042/32.png) [@paulstgeorge](https://discourse.processing.org/u/paulstgeorge)
#### Post date: [October 19, 2024, 2:19pm UTC](https://discourse.processing.org/t/get-vertex-count/45200/4 "2024-10-19T14:19:19Z")

</div>

@mrbbp Thank you.

EDIT: The problem has been solved.  
The solution is tripartite.

1. Change the code from `size(640, 360);` to s`ize(640, 360, P2D);`
2. When saving SVG, Use Minimal and Minify in SVG options.
3. Add `noLoop();` to setup code, otherwise sketch never gets to report.

 ![Screenshot 2024-10-20 at 08.27.54](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/0/4/0454507e9770874cc714d19902e49ef95a94ebde.png)
