Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
line-path-fillet
Advanced tools
A line path filleting micro-library
Check it out in action: https://hassoncs.github.io/line-path-fillet/
This library's primary purpose is to fillet (round) the corner between two line segments.
If the line segments are too small to form a fillet arc at the requested radius, the largest possible radius will be used.
// With four points, A, B, C, and D specified as x,y arrays of length 2:
const pointA = [0, 0];
const pointB = [0, 0];
const pointC = [0, 0];
const pointD = [0, 0];
// First we find the intersection point of the line segments
// This will project the lines as needed in order to find
// the first possible intersection point.
// It will return null if the lines will never intersect.
const intersectionPoint = findIntersection(
pointA[0],
pointA[1],
pointB[0],
pointB[1],
pointC[0],
pointC[1],
pointD[0],
pointD[1],
);
if (!intersectionPoint) return;
const radius = 100;
const filletData = filletCorner(
pointA,
intersectionPoint,
pointC,
radius,
);
// Now we have everything we need to draw the arc:
const {
radius, // The radius we ended up using (might be smaller than the specified radius)
angleA, // Angle from the fillet circle center to the tangent point on line A->I
angleB, // Angle from the fillet circle center to the tangent point on line B->I
tanPointA, // Arc start point
tanPointB, // Arc end point
circleCenter, // Center point of the fillet circle
} = filletData;
npm run build
npm run publish
cd demo-app
npm install
npm run start
# To build the app
npm run build
# Release it to github pages
npm run deploy
FAQs
A line path filleting micro-library
We found that line-path-fillet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.