src/STLVertex.php
public static function fromString(string $stlVertexString) : STLVertex
    {
        $class = new self();

        preg_match_all("/vertex +(\-*\d+\.*\d*e*\-*\+*\d*) +(\-*\d+\.*\d*e*\-*\+*\d*) +(\-*\d+\.*\d*e*\-*\+*\d*)/",
            $stlVertexString, $matches);

        $coordinates = array(
            array((float)$matches[1][0], (float)$matches[2][0], (float)$matches[3][0]),
            array((float)$matches[1][1], (float)$matches[2][1], (float)$matches[3][1]),
            array((float)$matches[1][2], (float)$matches[2][2], (float)$matches[3][2])
        );

        $class->setCoordinatesArray($coordinates);

        return $class;
    }
public static function fromString(string $stlVertexString) : STLVertex
    {
        $class = new self();

        preg_match_all("/vertex +(\-*\d+\.*\d*e*\-*\+*\d*) +(\-*\d+\.*\d*e*\-*\+*\d*) +(\-*\d+\.*\d*e*\-*\+*\d*)/",
            $stlVertexString, $matches);

        $coordinates = array(
            array((float)$matches[1][0], (float)$matches[2][0], (float)$matches[3][0]),
            array((float)$matches[1][1], (float)$matches[2][1], (float)$matches[3][1]),
            array((float)$matches[1][2], (float)$matches[2][2], (float)$matches[3][2])
        );

        $class->setCoordinatesArray($coordinates);

        return $class;
    }
public static function fromString ( string $ stlVertexString ) : STLVertex { $ class = new self ( ) ; preg_match_all ( "/vertex +(\-*\d+\.*\d*e*\-*\+*\d*) +(\-*\d+\.*\d*e*\-*\+*\d*) +(\-*\d+\.*\d*e*\-*\+*\d*)/" , $ stlVertexString , $ matches ) ; $ coordinates = array ( array ( ( float ) $ matches [ 1 ] [ 0 ] , ( float ) $ matches [ 2 ] [ 0 ] , ( float ) $ matches [ 3 ] [ 0 ] ) , array ( ( float ) $ matches [ 1 ] [ 1 ] , ( float ) $ matches [ 2 ] [ 1 ] , ( float ) $ matches [ 3 ] [ 1 ] ) , array ( ( float ) $ matches [ 1 ] [ 2 ] , ( float ) $ matches [ 2 ] [ 2 ] , ( float ) $ matches [ 3 ] [ 2 ] ) ) ; $ class -> setCoordinatesArray ( $ coordinates ) ; return $ class ; }
Class constructor from an STL vertex string.

Example vertex string:
outerloop
vertex -71.74323 47.70205 4.666243
vertex -72.13071 47.70205 4.932664
vertex -72.1506 47.2273 4.905148
endloop

@param string $stlVertexString
@return STLVertex
Class constructor from an STL vertex string .