Offset from edges (Conditions Issue)

hello.

I am here to ask a question regarding logic and a script I am working on.

I am trying to draw an offset from all edges. I am able to achieve my goal to some extent but there is a problem when there is an opening in a slab the script works in an opposite way for the opening. As shown in the figure the script is able to detect edges and draw offset on the inside of corners or on the slab (yellow lines) but when comes to opening it selects edges and draws offset on the inside whole space (red) whereas it should be also on slab(black line).

I tried to change the conditions but I am not able to do it.

image

solution i tried to add a codeblock and conditions to seperate edges from openings. it gives this error

FFINAL EDGES.dyn (95.2 KB)

Your concern regarding this would be helpful. Thank you in advance.

Check your lines with the Line.Direction node.
All clockwise?

yes sir.

1 Like

Dont you need more offset on the void? (By looking at your sketch you do)
Make sure you Offset nodes use a different set of values

Take the curve loops and sort them by area. This will likely requiring making a surface of each.

All but the last curve loop will want to be offset with a inverted value (-n). The last line will not want to be inverted (+n).

This is because offset is always ‘right side’ of the line, and the lines will always be clockwise so ‘into’ the interior of the loop. container; by inverting the distance you go ‘backwards’ and wind up outside of the loop.