Skip to main content

Hi guys,

 

I'm looking for a way to adjust vertex order in triangles. First point should be the one with smallest angle between two edges. Remaining vertixes are to be oriented counter clockwise. Is there a build in transformer that offers such functionality or does anyone have a ready to use solution/idea?

 

Thanks in advance!

Hi! Now this seems like a fun challenge. If it's an equilateral triangle, what do we expect to happen then? Or if two angles are the same?

 

I'll sketch something up for the default case and see what we can make of it. Do you have some sample data, or can any ol' triangle work for my trials?


  1. Extract coordinates
  2. Work out each angle
  3. Rebuild geometry starting at coordinate at smallest angle
  4. Check orientation
  5. Reverse orientation if not counter clockwise already

CaptureCapture


  1. Extract coordinates
  2. Work out each angle
  3. Rebuild geometry starting at coordinate at smallest angle
  4. Check orientation
  5. Reverse orientation if not counter clockwise already

CaptureCapture

Hi @ebygomm​ ,

 

that looks very promising! I'm currently fiddling with the GeometryReplacer. Which Geometry Encoding Option are you using to pass your triangle attribute over?


Hi @ebygomm​ ,

 

that looks very promising! I'm currently fiddling with the GeometryReplacer. Which Geometry Encoding Option are you using to pass your triangle attribute over?

I create an attribute which is a string of well known text (WKT)

 

e.g. POLYGON ((10 5,0 0,10 0,10 5))

and then use this as the geometry source with encoding of OGC Well Known Text


Hi @ebygomm​ ,

 

that looks very promising! I'm currently fiddling with the GeometryReplacer. Which Geometry Encoding Option are you using to pass your triangle attribute over?

Managed to figure out, you've been using OGC Well Known Text. I've had a typo (missing bracket) in my POLYGON string.


Reply