MCPcopy Create free account
hub / github.com/LibreCAD/LibreCAD / getRandomRay

Function getRandomRay

librecad/src/lib/engine/lc_looputils.cpp:126–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126std::unique_ptr<RS_Line> getRandomRay(RS_EntityContainer* loop)
127{
128 assert(loop != nullptr);
129 RS_Vector p0 = getInternalPoint(*loop);
130 double size = loop->getSize().magnitude();
131 return std::make_unique<RS_Line>(nullptr, p0, p0 + RS_Vector{getRandomAngle()}*size);
132}
133
134std::unordered_map<const RS_EntityContainer*, double> findAreas(const std::vector<std::unique_ptr<RS_EntityContainer>>& loops )
135{

Callers 1

findAncestorsMethod · 0.85

Calls 4

getInternalPointFunction · 0.85
getRandomAngleFunction · 0.85
magnitudeMethod · 0.80
getSizeMethod · 0.45

Tested by

no test coverage detected