Checking maximum slot length around corners

Document created by burr_shaw on Oct 9, 2012
Version 1Show Document
  • View in full screen mode

The trick is to disconnect the end of the paths from the sides.
Then the length of a composite edge may be obtained with PATH LENGTH.

Example:


VARIABLE MAX_SLOT_LENGTH 200
// max slot width is needed to differentiate sides from ends.
VARIABLE MAX_SLOT_WIDTH 4


// get m1 slot
m1_slot = HOLES M1 INNER EMPTY


// get slot edges
m1_slot_edge = COINCIDENT EDGE m1_slot M1


//slot ends, defined as a short outside edge
m1_slot_edge_ends = CONVEX EDGE m1_slot_edge == 2 WITH LENGTH <= MAX_SLOT_WIDTH


// remove slot ends
m1_slot_edge_sides = m1_slot_edge NOT COINCIDENT EDGE m1_slot_edge_ends


// get edges longer than the limit
long_slot_edge_sides = PATH LENGTH m1_slot_edge_sides > MAX_SLOT_LENGTH


// get slot with edges longer than the limit
long_slot = m1_slot WITH EDGE long_slot_edge_sides


long_slot {
    COPY long_slot
}

 

In the following picture the slots in the objects on the right each have an outside distance > 200, those on the left are <= 200.

Attachments

    Outcomes