Implementing QuadInCircleTouch/TangentIncircles in Script

Hi @DanielPiker,

I’m implementing isothermic mesh goals in GhPython and am trying to figure out the arguments for the involved goals. As far as I can tell, QuadInCircleTouch takes an array of six points. I assume this might be the six vertices of two adjacent quad faces, but what is their order? And TangentIncircles appears to take four points, are those the vertices of the quad faces?

Hope you’re doing great :kangaroo:

Best,

Anders

Edit: For context, I’m dealing with quite a lot of goals and have noticed that I can generally make goals a lot faster with scripting components by avoiding the casting output penalty, which also appears to be present with the compiled Kangaroo2 goal components. If you recall, this goes all the way back to the Joey/Hybrid Tower/SG2016 days, where I would wrap goals in e.g. Python dicts. But for the past couple of years I’ve been using GH_ObjectWrapper, which also works and is a nice general solution I find. Here’s a quick example:

1 Like

Hi Anders,

The 6 points for QuadInCircleTouch are indeed the vertices of a pair of adjacent quads. They are ordered around the perimeter, like so:

5-4-3
| | |
0-1-2

For triangles with the TangentIncircles goal, it is

  1
 /|\
3 | 2
 \|/
  0

(I realise now that having both be cyclical around the perimeter of the hex/quad formed by the pair of adjacent quads/tris would have been more consistent, but that’s how it is)
For TangentIncircles there’s also a helper method Util.GetHingePoints, which takes a mesh and returns a list of arrays of the appropriately ordered 4 points for each internal edge.

2 Likes

Excellent, thanks so much Dan. I forgot about Util.GetHingePoints, that’ll be super useful. And those little diagrams really sent me down memory lane! Have a great Sunday :raising_hands:

I only just realised that one might inspect a goal PPos property to figure out the order:

Though the order here appears different than your diagram @DanielPiker? I’m probably missing something.