Geometry
rigatoni.ByteServer
ByteServer(port=8000)
Bases: object
Server to Host URI Bytes.
This is helpful for large meshes and images that would otherwise be too large to send using CBOR and the websocket connection. The server maps a tag to a buffer, and the client can request the buffer using the url that includes the tag.
Note
The server is start up automatically in a new thread when the class is instantiated, and
shutdown
must be called to clean up this thread.
Attributes:
Name | Type | Description |
---|---|---|
host |
str
|
IP address for server |
port |
int
|
port server is listening on |
socket |
socket
|
socket connection |
buffers |
dict
|
mapping tag to buffer |
_next_tag |
int
|
next available tag for a buffer |
url |
str
|
base url to reach server without tag |
thread |
Thread
|
background thread server is running in |
running |
bool
|
flag indicating whether server is running |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port |
int
|
port to listen and host on |
8000
|
Source code in rigatoni/byte_server.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
add_buffer
add_buffer(buffer)
Add buffer to server and return url to reach it
Parameters:
Name | Type | Description | Default |
---|---|---|---|
buffer |
bytes
|
bytes to add as buffer |
required |
Source code in rigatoni/byte_server.py
129 130 131 132 133 134 135 136 137 138 139 140 141 |
|
get_buffer
get_buffer(uri)
Helper to get bytes for a URI
Mostly used in geometry creation for exporting as of right now
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uri |
str
|
uri for bytes |
required |
Source code in rigatoni/byte_server.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
shutdown
shutdown()
Stop running thread
Source code in rigatoni/byte_server.py
143 144 145 146 147 |
|
rigatoni.geometry.methods
Helpful methods for assisting with the creation of geometry objects
rigatoni.geometry.objects
Module with additional objects to help with geometry creation
These are based on the noodle_objects.py module and implement validation