MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / IsPointInside

Method IsPointInside

src/GCodes/KeepoutZone.cpp:112–129  ·  view source on GitHub ↗

Check whether a point is inside the keepout zone, returning true if it is

Source from the content-addressed store, hash-verified

110
111// Check whether a point is inside the keepout zone, returning true if it is
112bool KeepoutZone::IsPointInside(const GCodeBuffer &gb, const float *pointCoords) const noexcept
113{
114 if (!active || axesChecked.IsEmpty())
115 {
116 return false;
117 }
118
119 bool inside = true;
120 axesChecked.IterateWhile([this, pointCoords, &outside](unsigned int axis, unsigned int)->bool
121 {
122 if (pointCoords[axis] <= coords[axis][0] || pointCoords[axis] >= coords[axis][1])
123 {
124 inside = false;
125 };
126 return inside;
127 });
128 return inside;
129}
130
131#endif
132

Callers

nothing calls this directly

Calls 2

IterateWhileMethod · 0.80
IsEmptyMethod · 0.45

Tested by

no test coverage detected