PHP port of https://github.com/mourner/simplify-js
require_once 'vendor/autoload.php';
Simplify::run($points, $tolerance, $highestQuality);
composer package name is andreychumak/simplify-php
PHP port of mourner/simplify-js
License: BSD 2-Clause "Simplified" License
PHP port of https://github.com/mourner/simplify-js
require_once 'vendor/autoload.php';
Simplify::run($points, $tolerance, $highestQuality);
composer package name is andreychumak/simplify-php
I grabbed the latest zip package.
when I test "test.php" I get an error, similar to when I test the main PHP script:
PHP Parse error: syntax error, unexpected '[' in Simplify.php on line 69
When following your instructions in the README to include the vendor/autoload.php
and then simply make a call to Simplify::run()
I get a Class 'Simplify' not found
error.
Iโm new to Composer. How to make it work?
This line seems to be a mistranslation of the JavaScript version:
$sqTolerance = (int)$tolerance == $tolerance ? $tolerance*$tolerance : 1;
If a float is passed for $tolerance, then it will be ignored and the default value of 1 will be used instead. Shouldn't it just be this?
$sqTolerance = $tolerance * $tolerance;
The test in the JavaScript original is just to handle the default value, but PHP handles that automatically.
I was getting all kinds of divide by zero warnings until I changed line 112 from:
if ($dx !== 0 || $dy !== 0) {
... to:
if (intval($dx) !== 0 || intval($dy) !== 0) {
--- or ---
if ($dx !== 0.0 || $dy !== 0.0) {
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.