Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
space-colonization
Advanced tools
Algorithm for tree-like and bush-like objects. Based on this paper.
$ npm i -S space-colonization
Options:
buds
: array of buds position in the format [x, y, z]. This is where your tree is going to grow fromhormones
: array of hormones (aka attractors) in the format [x, y, z]. Read the paper for more info on what they are. But simply put, they attract the branch to grow towards them. Can be randomly generated, for more sophisticated type of trees you can generate points inside a crown-like shape. More examples on how to do this will be added soon.deadZone
: the radius of which hormones are killed after each iteration. read the paper for more info. defaults to 0.1
growthStep
: how far a branch can jump on each iteration. defaults to 0.3
splitChance
: how likely it is to split on each iteration. defaults to 0.4
viewAngle
: the angle at which an alive bud (the tip of a growing branch) can see hormones. defaults to 30
(measured in degrees)viewDistance
: how far the alive bud can see hormones. defaults to 0.5
branchAngle
: when a split happens, how far the two new branches bend away from each other. defaults to 30
(measured in degrees)straightSplit
: if true
, only new branch bends to the branchAngle
. if false
, both old and new branches bend (i. e. you get a V-like shape)These numbers (except the angles) assume the buds and hormones have a distance between them in the same range (e.g. from 0 to 5). If you provide positions that have a range of 10-50 for example nothing will grow because the viewDistance
is too small for the initial bud to see anything!
When you call the above function you get back an iterate function. This function can be called every frame to grow the tree until all hormones are dead or all buds die before they eat all possible hormones. The result of each call is an object with two properties:
buds
: an array of buds with each bud an object with properties:
state
: 0
for alive, 1
for deadposition
: [x, y, z]parentIndex
: the index of the parent bud in the buds array. -1
if no parenthormones
: an array of hormones with each hormone an object with two properties:
state
: 0
for alive, 1
for deadposition
: [x, y, z]More info and examples will be coming soon. Post an issue if anything is unclear. See example.js for basic usage with regl.
MIT
FAQs
space colonization algorithm
We found that space-colonization 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.