Buckets:
| import axios from 'axios'; | |
| const API_BASE = 'http://localhost:8000/api'; | |
| export const api = { | |
| // Projects | |
| async getProjects() { | |
| const response = await axios.get(`${API_BASE}/projects/`); | |
| return response.data; | |
| }, | |
| async createProject(name: string, description?: string) { | |
| const response = await axios.post(`${API_BASE}/projects/`, { name, description }); | |
| return response.data; | |
| }, | |
| async getProject(id: string) { | |
| const response = await axios.get(`${API_BASE}/projects/${id}`); | |
| return response.data; | |
| }, | |
| async deleteProject(id: string) { | |
| const response = await axios.delete(`${API_BASE}/projects/${id}`); | |
| return response.data; | |
| }, | |
| // Geometry | |
| async createBox(length: number, width: number, height: number, center?: number[]) { | |
| const response = await axios.post(`${API_BASE}/geometry/box`, { | |
| length, width, height, | |
| center: center || [0, 0, 0] | |
| }); | |
| return response.data; | |
| }, | |
| async createCylinder(radius: number, height: number, center?: number[]) { | |
| const response = await axios.post(`${API_BASE}/geometry/cylinder`, { | |
| radius, height, | |
| center: center || [0, 0, 0] | |
| }); | |
| return response.data; | |
| }, | |
| async createSphere(radius: number, center?: number[]) { | |
| const response = await axios.post(`${API_BASE}/geometry/sphere`, { | |
| radius, | |
| center: center || [0, 0, 0] | |
| }); | |
| return response.data; | |
| }, | |
| async getGeometryMeshData(geometryId: string) { | |
| const response = await axios.get(`${API_BASE}/geometry/${geometryId}/mesh-data`); | |
| return response.data; | |
| }, | |
| // Mesh | |
| async generateMesh(geometryId: string, elementSize: number = 0.1) { | |
| const response = await axios.post(`${API_BASE}/mesh/generate`, { | |
| geometry_id: geometryId, | |
| element_size: elementSize | |
| }); | |
| return response.data; | |
| }, | |
| async getMeshData(meshId: string) { | |
| const response = await axios.get(`${API_BASE}/mesh/${meshId}/data`); | |
| return response.data; | |
| }, | |
| async refineMesh(meshId: string) { | |
| const response = await axios.post(`${API_BASE}/mesh/${meshId}/refine`); | |
| return response.data; | |
| } | |
| }; | |
Xet Storage Details
- Size:
- 2.12 kB
- Xet hash:
- 24acf0141630e26966909c7fc26fa36b30af1c0e39c8a368078160d3ac37b1b0
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.