### CLI Conversion Commands Source: https://context7.com/lparksi/skp2gltf/llms.txt Examples of using the CLI for various conversion formats and compression settings. ```bash # Basic usage skp2gltf.exe [options] # Convert to GLB format (default) skp2gltf.exe building.skp ./output building_model # Convert to glTF format skp2gltf.exe building.skp ./output building_model gltf # Enable Draco compression with default settings skp2gltf.exe building.skp ./output building_model glb draco # Full Draco compression with custom quantization settings skp2gltf.exe building.skp ./output building_compressed glb draco \ draco-speed:3 draco-pos:16 draco-tex:14 draco-norm:12 # Enable KTX2 texture compression with UASTC format skp2gltf.exe building.skp ./output building_optimized glb draco \ ktx2 ktx2-quality:192 ktx2-uastc tex-res:2048 # Output shows conversion progress # Start conversion # Draco settings: speed=3, pos=16, tex=14, norm=12 # finished ``` -------------------------------- ### Docker Quick Start Source: https://context7.com/lparksi/skp2gltf/llms.txt Commands to pull the multi-platform image and run the tool in either microservice or CLI mode. ```bash # Pull the latest image (auto-matches AMD64 or ARM64) docker pull ghcr.io/lparksi/skp2gltf:latest # Run as HTTP microservice on port 8000 (recommended for production) docker run -d --name skp_api -p 8000:8000 ghcr.io/lparksi/skp2gltf:latest --service # Run CLI mode for single file conversion with Draco compression docker run --rm -v "${PWD}:/work" ghcr.io/lparksi/skp2gltf:latest \ /work/model.skp /work/output result glb draco ``` -------------------------------- ### Run as HTTP Microservice Source: https://github.com/lparksi/skp2gltf/blob/main/README_en.md Start the container in service mode to keep the environment in memory for faster processing. ```bash # Start service on port 8000 docker run -d --name skp_api -p 8000:8000 ghcr.io/lparksi/skp2gltf:latest --service ``` -------------------------------- ### Example Conversion Request Source: https://context7.com/lparksi/skp2gltf/llms.txt Instantiate a ConvertRequest object to specify conversion parameters like input/output paths, format, and compression options. ```python request = ConvertRequest( input_path="/work/building.skp", output_dir="/work/output", format="glb", draco=True, draco_speed=3, ktx2=True, tex_res=2048 ) ``` -------------------------------- ### Run as HTTP Microservice Source: https://github.com/lparksi/skp2gltf/blob/main/README.md Start the container in service mode to enable persistent background processing via HTTP. ```bash docker run -d --name skp_api -p 8000:8000 ghcr.io/lparksi/skp2gltf:latest --service ``` -------------------------------- ### Native Windows Build and Conversion Source: https://context7.com/lparksi/skp2gltf/llms.txt Build the SKP2GLTF executable on Windows using CMake and Visual Studio, then perform a conversion. Ensure prerequisites like Visual Studio, CMake, and SketchUp are installed. ```bash # Prerequisites: Visual Studio 2019+, CMake 3.14+, SketchUp 2019+ (for runtime) # Clone and enter project directory git clone https://github.com/lparksi/skp2gltf.git cd skp2gltf # Create build directory mkdir build && cd build # Configure with CMake (Release build) cmake .. -G "Visual Studio 16 2019" -A x64 # Build the project cmake --build . --config Release # The executable will be at: build/Release/skp2gltf.exe # Required DLLs are copied automatically: SketchUpAPI.dll, SketchUpCommonPreferences.dll # Run conversion ./Release/skp2gltf.exe ../test/test.skp ./output test_model glb draco ``` -------------------------------- ### GET /health Source: https://context7.com/lparksi/skp2gltf/llms.txt Retrieves the current status of the conversion service, including architecture details and display server status. ```APIDOC ## GET /health ### Description Provides service status information including architecture detection and Xvfb display server status. ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **status** (string) - The current status of the service (e.g., "ready"). - **architecture** (string) - The detected system architecture. - **xvfb_active** (boolean) - Indicates if the Xvfb display server is active. #### Response Example { "status": "ready", "architecture": "x86_64", "xvfb_active": true } ``` -------------------------------- ### Run via Command Line Source: https://github.com/lparksi/skp2gltf/blob/main/README_en.md Execute conversion tasks locally by mounting a volume to the container. ```bash docker run --rm -v "${PWD}:/work" ghcr.io/lparksi/skp2gltf:latest \ /work/model.skp /work/output result glb draco ``` -------------------------------- ### Build from Source Source: https://github.com/lparksi/skp2gltf/blob/main/README_en.md Compile the project on Windows using CMake. ```bash cmake .. cmake --build . --config Release ``` -------------------------------- ### Command Line Interface (CLI) Usage Source: https://github.com/lparksi/skp2gltf/blob/main/README.md Instructions for running SKP2GLTF as a command-line tool within a Docker container for single conversion tasks. ```APIDOC ## SKP2GLTF CLI Conversion ### Description Run SKP2GLTF directly from the command line within a Docker container for local file conversions. ### Method N/A (CLI execution) ### Endpoint N/A (CLI execution) ### Parameters - **input.skp** (string) - Required - Path to the input .skp file. - **output_dir** (string) - Required - Directory to save the converted file. - **output_name_or_path** (string) - Required - Name or full path for the output file. - **format** (string) - Optional - Output format ('glb' or 'gltf'). Defaults to 'glb'. - **draco** (string) - Optional - Enable Draco compression. Accepts 'draco', 'true', or '--draco'. ### Request Example ```bash docker run --rm -v "${PWD}:/work" ghcr.io/lparksi/skp2gltf:latest \ /work/model.skp /work/output result glb draco ``` ### Response - The converted file will be saved to the specified output path. ``` -------------------------------- ### Batch process files with Python Source: https://context7.com/lparksi/skp2gltf/llms.txt Uses httpx and asyncio to iterate through a directory and convert multiple SketchUp files. ```python import httpx import asyncio from pathlib import Path async def batch_convert(input_dir: str, output_dir: str): async with httpx.AsyncClient(base_url="http://localhost:8000", timeout=300.0) as client: skp_files = list(Path(input_dir).glob("*.skp")) results = [] for skp_file in skp_files: payload = { "input_path": str(skp_file), "output_dir": output_dir, "output_name": skp_file.stem, "format": "glb", "draco": True, "draco_speed": 5, "ktx2": True, "ktx2_quality": 128 } response = await client.post("/convert-path", json=payload) if response.status_code == 200: result = response.json() results.append({"file": skp_file.name, "status": "success", "output": result["dest"]}) else: results.append({"file": skp_file.name, "status": "failed", "error": response.json()["detail"]}) return results # Process all files in mounted directory results = asyncio.run(batch_convert("/work/models", "/work/output")) for r in results: print(f"{r['file']}: {r['status']}") ``` -------------------------------- ### POST /convert Source: https://context7.com/lparksi/skp2gltf/llms.txt Accepts a SketchUp file upload and returns the converted glTF/GLB file as a streaming response with optional compression settings. ```APIDOC ## POST /convert ### Description Accepts SketchUp file uploads and returns the converted glTF/GLB file as a streaming response. ### Method POST ### Endpoint /convert ### Parameters #### Query Parameters - **format** (string) - Optional - Output format (glb or gltf). - **draco** (boolean) - Optional - Enable Draco mesh compression. #### Request Body - **file** (binary) - Required - The SketchUp (.skp) file to convert. - **draco_speed** (integer) - Optional - Draco compression speed setting. - **draco_pos_bits** (integer) - Optional - Draco position quantization bits. - **draco_tex_bits** (integer) - Optional - Draco texture quantization bits. - **draco_norm_bits** (integer) - Optional - Draco normal quantization bits. - **tex_res** (integer) - Optional - Texture resolution. - **ktx2** (boolean) - Optional - Enable KTX2 texture compression. - **ktx2_quality** (integer) - Optional - KTX2 quality setting. - **ktx2_uastc** (boolean) - Optional - Enable UASTC format for KTX2. ### Response #### Success Response (200) - **file** (binary) - The converted 3D model file stream. ``` -------------------------------- ### Pull Docker Image Source: https://github.com/lparksi/skp2gltf/blob/main/README.md Download the latest SKP2GLTF Docker image, which automatically matches the host architecture. ```bash docker pull ghcr.io/lparksi/skp2gltf:latest ``` -------------------------------- ### Convert files via path-based endpoint Source: https://context7.com/lparksi/skp2gltf/llms.txt Demonstrates running the service via Docker and performing a conversion request using curl. ```bash # Mount a directory and convert files by path docker run -d --name skp_api -p 8000:8000 \ -v /data/models:/work \ ghcr.io/lparksi/skp2gltf:latest --service # Convert using container paths curl -X POST "http://localhost:8000/convert-path" \ -H "Content-Type: application/json" \ -d '{ "input_path": "/work/building.skp", "output_dir": "/work/output", "output_name": "building_converted", "format": "glb", "draco": true, "draco_speed": 5, "draco_pos_bits": 14, "tex_res": 2048 }' ``` -------------------------------- ### Extract metadata from SketchUp files Source: https://context7.com/lparksi/skp2gltf/llms.txt Demonstrates extracting model statistics using a multipart form-data request. ```bash # Extract metadata from a SketchUp file curl -X POST "http://localhost:8000/metadata" \ -F "file=@model.skp" ``` -------------------------------- ### Material Configuration JSON Source: https://context7.com/lparksi/skp2gltf/llms.txt Define PBR material mappings for automatic metallic and roughness value assignment based on keywords found in material names. Includes default values for unmapped materials. ```json { "mappings": [ { "keywords": ["metal", "steel", "iron", "aluminum", "chrome"], "metallic": 1.0, "roughness": 0.2 }, { "keywords": ["glass", "water", "mirror", "polished"], "metallic": 0.0, "roughness": 0.05 }, { "keywords": ["wood", "stone", "brick", "concrete", "fabric", "cloth"], "metallic": 0.0, "roughness": 0.8 }, { "keywords": ["plastic", "paint"], "metallic": 0.0, "roughness": 0.4 } ], "defaults": { "metallic": 0.0, "roughness": 0.6 } } ``` -------------------------------- ### POST /convert-path Source: https://context7.com/lparksi/skp2gltf/llms.txt Converts a SketchUp file located at a specific path within the container to glTF or GLB format. ```APIDOC ## POST /convert-path ### Description Converts files at specified container paths, useful for volume-mounted directories and batch processing. ### Method POST ### Endpoint /convert-path ### Request Body - **input_path** (string) - Required - Path to the input .skp file in the container - **output_dir** (string) - Optional - Output directory (default: /work/output) - **output_name** (string) - Optional - Output filename without extension - **format** (string) - Optional - Output format: "glb" or "gltf" (default: glb) - **draco** (boolean) - Optional - Enable Draco mesh compression (default: False) - **draco_speed** (integer) - Optional - Draco encoding speed 0-10 (default: 5) - **draco_pos_bits** (integer) - Optional - Draco position quantization bits 8-24 (default: 14) - **draco_tex_bits** (integer) - Optional - Draco texture coordinate quantization bits 8-16 (default: 12) - **draco_norm_bits** (integer) - Optional - Draco normal quantization bits 6-16 (default: 10) - **tex_res** (integer) - Optional - Maximum texture resolution 64-4096 (default: 1024) - **ktx2** (boolean) - Optional - Enable KTX2/Basis texture compression (default: False) - **ktx2_quality** (integer) - Optional - KTX2 compression quality 1-255 (default: 128) - **ktx2_uastc** (boolean) - Optional - Use UASTC format for KTX2 (default: True) ### Request Example { "input_path": "/work/building.skp", "output_dir": "/work/output", "output_name": "building_converted", "format": "glb", "draco": true } ### Response #### Success Response (200) - **status** (string) - Success status - **dest** (string) - Path to the generated file #### Response Example { "status": "success", "dest": "/work/output/building_converted.glb" } ``` -------------------------------- ### Pull Docker Image Source: https://github.com/lparksi/skp2gltf/blob/main/README_en.md Download the latest multi-platform image from the GitHub Container Registry. ```bash # Auto-matches architecture (AMD64 or ARM64) docker pull ghcr.io/lparksi/skp2gltf:latest ``` -------------------------------- ### Add skp2native Library Source: https://github.com/lparksi/skp2gltf/blob/main/src/skp/CMakeLists.txt Defines the skp2native library by compiling all .cpp files in the current directory. Ensure all necessary .cpp files are present. ```cmake file(GLOB CPPFILE ./*.cpp) add_library(skp2native ${CPPFILE}) ``` -------------------------------- ### Configure Include Directories for skp2native Source: https://github.com/lparksi/skp2gltf/blob/main/src/skp/CMakeLists.txt Specifies private include directories for the skp2native library. These paths are essential for resolving header files during compilation. ```cmake target_include_directories(skp2native PRIVATE ${PROJECT_SOURCE_DIR}/include/skp ${PROJECT_SOURCE_DIR}/thirdparty/SketchUpAPI ${PROJECT_SOURCE_DIR}/thirdparty ) ``` -------------------------------- ### Extract metadata with Python Source: https://context7.com/lparksi/skp2gltf/llms.txt Uses httpx to send a file stream to the metadata endpoint and print the returned statistics. ```python import httpx import asyncio async def get_model_info(skp_path: str): async with httpx.AsyncClient(base_url="http://localhost:8000", timeout=60.0) as client: with open(skp_path, "rb") as f: files = {"file": (skp_path.split("/")[-1], f, "application/octet-stream")} response = await client.post("/metadata", files=files) if response.status_code == 200: metadata = response.json() print(f"Model Statistics:") print(f" Faces: {metadata.get('faces', 'N/A')}") print(f" Vertices: {metadata.get('vertices', 'N/A')}") print(f" Materials: {metadata.get('materials', 'N/A')}") return metadata else: print(f"Failed to extract metadata: {response.json()['detail']}") return None asyncio.run(get_model_info("building.skp")) ``` -------------------------------- ### File Upload Conversion Endpoint Source: https://context7.com/lparksi/skp2gltf/llms.txt Convert files via HTTP POST requests using curl or Python. ```bash # Basic conversion to GLB curl -X POST "http://localhost:8000/convert" \ -F "file=@model.skp" \ -o model.glb # Convert to glTF format with Draco compression curl -X POST "http://localhost:8000/convert?format=gltf&draco=true" \ -F "file=@building.skp" \ -o building.gltf # Full conversion with all options curl -X POST "http://localhost:8000/convert" \ -F "file=@scene.skp" \ -F "format=glb" \ -F "draco=true" \ -F "draco_speed=5" \ -F "draco_pos_bits=14" \ -F "draco_tex_bits=12" \ -F "draco_norm_bits=10" \ -F "tex_res=1024" \ -F "ktx2=true" \ -F "ktx2_quality=128" \ -F "ktx2_uastc=true" \ -o scene_optimized.glb ``` ```python import httpx import asyncio async def convert_file(input_path: str, output_path: str, draco: bool = True): async with httpx.AsyncClient(base_url="http://localhost:8000", timeout=120.0) as client: with open(input_path, "rb") as f: files = {"file": (input_path.split("/")[-1], f, "application/octet-stream")} params = {"format": "glb", "draco": str(draco).lower()} response = await client.post("/convert", files=files, params=params) if response.status_code == 200: with open(output_path, "wb") as out: out.write(response.content) print(f"Converted successfully: {len(response.content)} bytes") return True else: print(f"Conversion failed: {response.json()['detail']}") return False # Usage asyncio.run(convert_file("building.skp", "building.glb", draco=True)) ``` -------------------------------- ### Configure gltflib Include Directories Source: https://github.com/lparksi/skp2gltf/blob/main/src/gltflib/CMakeLists.txt Sets the public include directories for the gltflib library using CMake. These paths are necessary for the library to find its header files during compilation. ```cmake target_include_directories(gltflib PUBLIC ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/include/gltflib ${PROJECT_SOURCE_DIR}/thirdparty ${PROJECT_SOURCE_DIR}/thirdparty/tinygltf ) ``` -------------------------------- ### POST /metadata Source: https://context7.com/lparksi/skp2gltf/llms.txt Extracts model statistics and metadata from a provided SketchUp file. ```APIDOC ## POST /metadata ### Description Extracts model information from SketchUp files without performing full conversion. ### Method POST ### Endpoint /metadata ### Request Body - **file** (binary) - Required - The .skp file to analyze ### Response #### Success Response (200) - **faces** (integer) - Number of faces - **vertices** (integer) - Number of vertices - **materials** (integer) - Number of materials - **components** (integer) - Number of components - **groups** (integer) - Number of groups #### Response Example { "faces": 12450, "vertices": 8230, "materials": 15, "components": 42, "groups": 8 } ``` -------------------------------- ### CSkpExporter C++ API Configuration Source: https://context7.com/lparksi/skp2gltf/llms.txt Configure Draco compression and texture options using the C++ API before performing the conversion. Draco compression levels range from 0-10, and texture resolution up to 4096. ```cpp #include "skp/skp_exporter.h" int main() { // Create exporter instance CSkpExporter exporter; // Configure Draco compression options exporter.options().set_draco_speed(5); // 0-10, lower = smaller exporter.options().set_draco_position_bits(14); // 8-24 bits exporter.options().set_draco_tex_bits(12); // 8-16 bits exporter.options().set_draco_normal_bits(10); // 6-16 bits // Configure texture options exporter.options().set_texture_max_resolution(2048); // Max 4096 // Enable KTX2 texture compression exporter.options().set_use_ktx2(true); exporter.options().set_ktx2_quality(128); // 1-255 exporter.options().set_ktx2_uastc(true); // UASTC vs ETC1S // Perform conversion bool use_draco = true; bool success = exporter.Convert( "input.skp", // Source SketchUp file "./output/", // Output directory "model", // Output filename (without extension) "glb", // Format: "glb" or "gltf" use_draco, // Enable Draco compression nullptr // Progress callback (optional) ); if (success) { // Access conversion statistics CSkpExportStats& stats = exporter.stats(); std::cout << "Conversion complete" << std::endl; return 0; } std::cerr << "Conversion failed" << std::endl; return 1; } // Extract metadata without conversion std::string metadata_json = exporter.GetMetadataJson("input.skp"); std::cout << metadata_json << std::endl; ``` -------------------------------- ### SKP2GLTF API Endpoints Source: https://github.com/lparksi/skp2gltf/blob/main/README.md The SKP2GLTF tool can be run as an HTTP microservice. The following are the core API endpoints available. ```APIDOC ## GET /health ### Description Health check endpoint. Returns system architecture and running environment status. ### Method GET ### Endpoint /health ### Parameters None ### Request Example None ### Response #### Success Response (200) - **architecture** (string) - The system architecture (e.g., 'amd64', 'arm64'). - **environment** (string) - The running environment status (e.g., 'Wine OK', 'Xvfb OK'). #### Response Example ```json { "architecture": "amd64", "environment": "Wine OK" } ``` ``` ```APIDOC ## POST /convert ### Description File upload endpoint for converting .skp files to glTF/GLB format. Supports Draco mesh compression. ### Method POST ### Endpoint /convert ### Parameters #### Form Data Parameters - **file** (file) - Required - The .skp file to convert. - **format** (string) - Optional - The desired output format ('glb' or 'gltf'). Defaults to 'glb'. - **draco** (boolean) - Optional - Whether to enable Draco compression. Defaults to 'false'. ### Request Example ``` --boundary Content-Disposition: form-data; name="file"; filename="model.skp" Content-Type: application/octet-stream [binary content of model.skp] --boundary Content-Disposition: form-data; name="format" glb --boundary Content-Disposition: form-data; name="draco" true --boundary-- ``` ### Response #### Success Response (200) - **file_stream** (binary) - The converted glTF/GLB file content. ``` ```APIDOC ## POST /convert-path ### Description Endpoint for converting files specified by their absolute path within the container. Useful for batch processing or when files are already mounted. ### Method POST ### Endpoint /convert-path ### Parameters #### Request Body - **input_path** (string) - Required - The absolute path to the input .skp file inside the container. - **output_dir** (string) - Required - The absolute path to the directory where the converted file will be saved. - **output_name** (string) - Required - The desired name for the output file (without extension). - **format** (string) - Optional - The desired output format ('glb' or 'gltf'). Defaults to 'glb'. - **draco** (boolean) - Optional - Whether to enable Draco compression. Defaults to 'false'. ### Request Example ```json { "input_path": "/app/models/model.skp", "output_dir": "/app/output", "output_name": "converted_model", "format": "glb", "draco": true } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the conversion status and output path. ``` -------------------------------- ### SKP2GLTF API Endpoints Source: https://github.com/lparksi/skp2gltf/blob/main/README_en.md The SKP2GLTF tool provides a microservice API for converting .skp files to glTF/GLB format. The following endpoints are available when running the tool in service mode. ```APIDOC ## GET /health ### Description Health check endpoint. Returns the architecture and environment status of the SKP2GLTF service. ### Method GET ### Endpoint /health ### Parameters None ### Request Example None ### Response #### Success Response (200) - **architecture** (string) - The system architecture (e.g., "amd64", "arm64"). - **environment** (string) - The environment status (e.g., "wine", "xvfb"). #### Response Example ```json { "architecture": "amd64", "environment": "wine" } ``` ``` ```APIDOC ## POST /convert ### Description File upload endpoint for converting a single .skp file to glTF/GLB format. The converted file is returned as a stream. ### Method POST ### Endpoint /convert ### Parameters #### Form Data Parameters - **file** (file) - Required - The .skp file to convert. - **format** (string) - Optional - The desired output format. Accepts "glb" or "gltf". Defaults to "glb". - **draco** (boolean) - Optional - Whether to enable Draco mesh compression. Accepts "true" or "false". Defaults to "false". ### Request Example ``` --boundary Content-Disposition: form-data; name="file"; filename="model.skp" Content-Type: application/octet-stream [binary content of model.skp] --boundary Content-Disposition: form-data; name="format" gltf --boundary Content-Disposition: form-data; name="draco" true --boundary-- ``` ### Response #### Success Response (200) - **file stream** - The converted file content in the specified format (glb/gltf). ``` ```APIDOC ## POST /convert-path ### Description Path task endpoint for converting files located at a specific path within the container. The converted files are saved to the specified output directory. ### Method POST ### Endpoint /convert-path ### Parameters #### Request Body - **input_path** (string) - Required - The path to the input .skp file or directory within the container. - **output_dir** (string) - Required - The directory within the container where converted files will be saved. - **output_name** (string) - Optional - The base name for the output file(s). If converting a directory, this can be a prefix. - **format** (string) - Optional - The desired output format. Accepts "glb" or "gltf". Defaults to "glb". - **draco** (boolean) - Optional - Whether to enable Draco mesh compression. Accepts "true" or "false". Defaults to "false". ### Request Example ```json { "input_path": "/data/models/my_model.skp", "output_dir": "/data/output", "output_name": "converted_model", "format": "glb", "draco": true } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the conversion process has started or completed. #### Response Example ```json { "message": "Conversion task accepted. Files will be saved to /data/output." } ``` ``` -------------------------------- ### Define gltflib Library Source: https://github.com/lparksi/skp2gltf/blob/main/src/gltflib/CMakeLists.txt Defines the gltflib library using CMake, listing its source files. Ensure all listed source files are correctly placed within the project structure. ```cmake add_library(gltflib ${CMAKE_CURRENT_SOURCE_DIR}/creategltfcommon.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parsegltfcommon.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parsemeshdata.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gltfdraco.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tinygltf_impl.cpp ${PROJECT_SOURCE_DIR}/thirdparty/tinygltf/tiny_gltf.h ${PROJECT_SOURCE_DIR}/thirdparty/tinygltf/stb_image.h ${PROJECT_SOURCE_DIR}/thirdparty/tinygltf/stb_image_write.h ${PROJECT_SOURCE_DIR}/thirdparty/tinygltf/stb_image_resize2.h ${PROJECT_SOURCE_DIR}/include/gltflib/gltfdraco.h ${PROJECT_SOURCE_DIR}/include/gltflib/parsemeshdata.h ) ``` -------------------------------- ### Define conversion request schema Source: https://context7.com/lparksi/skp2gltf/llms.txt Pydantic model defining the available parameters for the /convert-path endpoint. ```python from pydantic import BaseModel from typing import Optional class ConvertRequest(BaseModel): # Required: Path to the input .skp file in the container input_path: str # Output directory (default: /work/output) output_dir: Optional[str] = "/work/output" # Output filename without extension (default: derived from input) output_name: Optional[str] = None # Output format: "glb" or "gltf" (default: glb) format: Optional[str] = "glb" # Enable Draco mesh compression (default: False) draco: Optional[bool] = False # Draco encoding speed 0-10, lower = smaller file (default: 5) draco_speed: Optional[int] = 5 # Draco position quantization bits 8-24 (default: 14) draco_pos_bits: Optional[int] = 14 # Draco texture coordinate quantization bits 8-16 (default: 12) draco_tex_bits: Optional[int] = 12 # Draco normal quantization bits 6-16 (default: 10) draco_norm_bits: Optional[int] = 10 # Maximum texture resolution 64-4096 (default: 1024) tex_res: Optional[int] = 1024 # Enable KTX2/Basis texture compression (default: False) ktx2: Optional[bool] = False # KTX2 compression quality 1-255 (default: 128) ktx2_quality: Optional[int] = 128 # Use UASTC format for KTX2, otherwise ETC1S (default: True) ktx2_uastc: Optional[bool] = True ``` -------------------------------- ### Link gltflib with Draco Library Source: https://github.com/lparksi/skp2gltf/blob/main/src/gltflib/CMakeLists.txt Links the gltflib library with the 'draco' library using CMake. This ensures that any Draco-specific functionality used by gltflib is available at link time. ```cmake target_link_libraries(gltflib PUBLIC draco ) ``` -------------------------------- ### Health Check Endpoint Source: https://context7.com/lparksi/skp2gltf/llms.txt Verify service status and architecture using curl or Python. ```bash # Check service health curl http://localhost:8000/health # Response { "status": "ready", "architecture": "x86_64", "xvfb_active": true } ``` ```python import httpx async def check_health(): async with httpx.AsyncClient(base_url="http://localhost:8000") as client: response = await client.get("/health") data = response.json() if data["status"] == "ready": print(f"Service ready on {data['architecture']}") print(f"Display server active: {data['xvfb_active']}") return data["status"] == "ready" ``` -------------------------------- ### Link Libraries for skp2native Source: https://github.com/lparksi/skp2gltf/blob/main/src/skp/CMakeLists.txt Links the gltf library as a private dependency to the skp2native library. This ensures that gltf library symbols are available during the linking phase. ```cmake target_link_libraries(skp2native PRIVATE gltflib ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.