![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
extrude-polyline
Advanced tools
Extrudes a 2D polyline with a given line thickness and the desired join/cap types. Tries to maintain visual consistency with HTML5 2D context stroking.
var polylne = [ [25, 25], [15, 60] ]
var stroke = require('extrude-polyline')({
thickness: 20,
cap: 'square',
join: 'bevel',
miterLimit: 10
})
//builds a triangulated mesh from a polyline
var mesh = stroke.build(polyline)
The returned mesh is a simplicial complex.
{
positions: [ [x,y], [x,y] ],
cells: [ [a,b,c], [a,b,c] ]
}
Currently, to achieve variable thickness you can provide a mapThickness
function to the stroke instance before building. By default, it will simply return the current thickness.
//create a falloff, so the thickness tapers toward the start of the path
stroke.mapThickness = function(point, index, points) {
return this.thickness * index/(points.length-1)
}.bind(stroke)
Git clone, npm install
, then npm run test
stroke = Extrusion([opt])
Creates a new path builder with the given settings:
thickness
the line thicknessmiterLimit
the limit before miters turn into bevels; default 10join
the join type, can be 'miter'
or 'bevel'
- default 'miter'cap
the cap type, can be 'butt'
or 'square'
- defalut 'butt'mesh = stroke.build(points)
Builds a stroke with the specified list of 2D points. Returns a simplicial complex.
Some features that could be useful to add at a later point. PRs welcome.
MIT, see LICENSE.md for details.
FAQs
triangulates a 2D polyline into a stroke
We found that extrude-polyline 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.