FindSurface Request for Web

1. HTTP Request URL

HTTP MethodRequest URL
POST https://developers.curvsurf.com/FindSurface/${findType}[.json]

${findType} must be replaced with one of following feature types:

Generally, FindSurface provides a response as binary format.
If you attach .json at the end of requested URL above, server will provide a response as JSON format.

Request Example

  1. Request Find Plane with binary format response

    https://developers.curvsurf.com/FindSurface/plane
  2. Request Find Torus with JSON format response

    https://developers.curvsurf.com/FindSurface/torus.json

2. HTTP Request Header

Required Fields

Header Name Header Value
Content-Type application/x-findsurface-request
Content-Length (the size of the body content, in bytes)

Optional Fields

NOTE: To use optional header field(s) below, Content-Type must be set to application/x-findsurface-request.
Header Name Header Value
Content-Encoding deflate
X-Content-Endian big
X-Accept-Endian big

3. HTTP Request Body Format

Request body consists of two parts: Header and Array of Point Attributes.

NOTE: Point Attributes must contains Position Attribute, which is a 3-dimensional vector.

Byte Table of Request Body

Body Header
01020304
Signature Version
Header Size
Point Count
Point Offset
Point Stride
Measurement Accuracy
Mean Distance
Touch Radius
Seed Index
Find Type Rad. Exp. Lat. Ext. Option Flags
Point Attributes Array
0102Point Stride
Point Attributes[0]
Point Attributes[1]
Point Attributes[2]
Point Attributes[Point Count - 1]

3.1. Body Header Description

Signature uint8_t[2]
"FS" : Signature bytes. [0] = 'F'; [1] = 'S'
Version uint8_t[2]
Version. [0] = major, [1] = minor
Current version is 1.0 ( major = 1, minor = 0 )
Header Size uint32_t
Byte size of this header.
40 ( for ver. 1.0 )
Point Count uint32_t
The number of Point Attributes in the array.
Point Offset uint32_t

A byte offset of the first position component of the first Point Attributes in the array.

**Please refer to Example 2 below.

Point Stride uint32_t
Byte offset between consecutive Point Attributes. If this value is 0, Point Attributes are understood to be tightly packed a 3-dimensional vector in the array.

**Please refer the examples below for the details.

Measurement Accuracy float (IEEE754 Single)
Point measurement accuracy.
Mean Distance float (IEEE754 Single)
Mean distance of neighboring points.
Touch Radius float (IEEE754 Single)
Radius of seed region.
Seed Index uint32_t
The index number of the interest point to recognize the specific surface.
Find Type uint8_t
Reserved.
This parameter is currently not used. Find Type is specified on a request URL.
This value must be set to '0'.
Rad. Exp. uint8_t
Radial Expansion: Level of segmentation referenced to the direction of the surface normal.
 0        1        -----        5        -----        10
off    moderate              default
                          (recommanded)         radical expansion
Lat. Ext. uint8_t
Lateral Extension: Level of region growing in lateral direction. (for plane, cylinder, cone)
 0        1        -----        5        -----        10
off    moderate              default
                          (recommanded)         radical extension
Option Flags uint8_t

Additional options specified in a combination of the following constants with or( | ) operator:

or 0x00 for not to use any option.

3.2. Body Data Example

Example 1

Suppose we have Point Attributes array of which each attribute contains position attribute (single precision) only. Such Point Attributes can be defined as C-like style code below:

typedef struct{ float x, y, z; } PointAttributes;

And also we have following conditions:

Offset Size Hex value Value Description
Header
0x00 2 46 53 "FS" Signature field
0x02 2 01 00 1.0 Version
0x04 4 28 00 00 00 40 bytes Size of this header
0x08 4 64 00 00 00 100 points The number of points
0x0C 4 00 00 00 00 0 byte offset Byte offset of first position attribute component.
For most of the cases this value is 0.
0x10 4 0C 00 00 00 12 byte Byte size per Point Attributes in the array.
or you may set the value to 0 with this example 1.
0x14 4 A6 9B 44 3B 0.003 Measurement Accuracy (error)
0x18 4 CD CC 4C 3D 0.05 Mean Distance
0x1C 4 CD CC 4C 3E 0.2 Touch Radius
0x20 4 1F 00 00 00 31 (32nd) Seed Index
0x24 1 00 Unused Currently not used.
0x25 1 05 Level 5 (default) Radial Expansion
0x26 1 05 Level 5 (default) Lateral Extension
0x27 1 00 No options Option Flags
Point Attributes Array
0x28 1200 Total Bytes = Point Count * Point Stride

Example 2

Suppose we have Point Attributes such as below (C-like style code):

typedef struct {
	uint32_t uniqueId;
	double x, y, z;
	uint32_t color;
} PointAttributes;

And also we have following conditions:

Offset Size Hex value Value Description
Header
0x00 2 46 53 "FS" Signature field
0x02 2 01 00 1.0 Version
0x04 4 28 00 00 00 40 bytes Size of this header
0x08 4 64 00 00 00 100 points The number of points
0x0C 4 04 00 00 00 4 byte offset Byte offset of first position attribute component.
0x10 4 20 00 00 00 32 byte Byte size per Point Attributes in the array.
0x14 4 A6 9B 44 3B 0.003 Measurement Accuracy (error)
0x18 4 CD CC 4C 3D 0.05 Mean Distance
0x1C 4 CD CC 4C 3E 0.2 Touch Raidus
0x20 4 1F 00 00 00 31 (32nd) Seed Index
0x24 1 00 Unused Currently not used.
0x25 1 05 Level 5 (default) Radial Expansion
0x26 1 05 Level 5 (default) Lateral Extension
0x27 1 02 Use double precision Option Flags
Point Attributes Array
0x28 3200 Total Bytes = Point Count * Point Stride