CAP3D-Viz: High-Performance 3D Visualization for CAP3D Files
Now Available on PyPI! Install with
pip install cap3d-viz- View on PyPI
CAP3D-Viz is a high-performance Python package for parsing and visualizing 3D geometry from CAP3D files generated by capacitance solvers. It features state-machine parsing, memory-efficient streaming, and interactive 3D visualization optimized for large datasets in integrated circuit design workflows.
Key Features
- State-Machine Parser: 70-80% reduction in condition checking with dispatch tables
- Memory Efficient: Handles 10,000+ blocks with <8MB memory usage
- High Performance: Parse speed of 9,882+ blocks/second
- Interactive 3D Visualization: Real-time filtering and exploration
- Batched Rendering: Smooth visualization of 50k+ blocks
- Professional IC Features: Industry-standard layer colors and visualization modes
- Comprehensive Format Support: Blocks, polygons, layers, windows, and tasks
Performance Benchmarks
| Metric | Performance |
|---|---|
| Parse Speed | 9,882 blocks/second |
| Memory Usage | <8MB for 10k blocks |
| Filter Latency | <500ms for interactive operations |
| Rendering | 50k+ blocks with batched optimization |
Installation
From PyPI (Recommended)
🎉 CAP3D-Viz is now available on PyPI!
pip install cap3d-viz
Development Installation
git clone https://github.com/andykofman/RWCap_view.git
cd RWCap_view
pip install -e .[dev]
Dependencies
- Python ≥3.8
- NumPy ≥1.19.0
- Plotly ≥5.0.0
- Matplotlib ≥3.3.0
Quick Start
Basic Usage
from cap3d_viz import load_and_visualize
# Load and visualize a CAP3D file
fig = load_and_visualize("your_file.cap3d")
fig.show()
Advanced Usage
from cap3d_viz import OptimizedCap3DVisualizer
# Create visualizer with custom settings
visualizer = OptimizedCap3DVisualizer(max_blocks_display=50000)
visualizer.load_data("large_file.cap3d")
# Create interactive visualization
fig = visualizer.create_optimized_visualization(
show_mediums=True,
show_conductors=True,
show_polys=True,
use_batched_rendering=True, # For large datasets
z_slice=5.0, # Cross-section view
opacity_mediums=0.3,
opacity_conductors=0.9
)
fig.show()
Performance-Optimized Parsing
from cap3d_viz import StreamingCap3DParser
# Parse large files efficiently
parser = StreamingCap3DParser("massive_file.cap3d")
data = parser.parse_complete()
print(f"Parsed {len(data.blocks)} blocks")
print(f"Found {len(data.poly_elements)} polygonal elements")
print(f"Layers: {len(data.layers)}")
CAP3D File Format Support
CAP3D-Viz provides comprehensive support for all CAP3D elements:
Structural Elements
<block>: 3D rectangular volumes with basepoint and vectors<poly>: Complex polygonal elements with custom 2D coordinates<medium>/<conductor>: Material sections with dielectric properties
Advanced Elements
<layer>: IC layer definitions (interconnect, via, metal, poly, contact)<window>: Simulation boundary definitions<task>: Capacitance calculation targets<coord>: 2D coordinate data for polygonal shapes
Example CAP3D Block
<block>
name block1
basepoint(-2, -2, 0) <!-- Starting corner -->
v1(4, 0, 0) <!-- Edge vector 1 -->
v2(0, 4, 0) <!-- Edge vector 2 -->
hvector(0, 0, 0.3) <!-- Height/thickness -->
</block>
Visualization Features
Interactive 3D Controls
- Mouse Controls: Rotate, zoom, pan with intuitive interaction
- Component Toggling: Show/hide mediums, conductors, polygons independently
- Layer Filtering: Focus on specific IC layers with professional colors
- Z-Slice Views: Cross-sectional visualization at any height
- Real-time Statistics: Block counts, volume analysis, dimensional info
Professional IC Design
- Industry-Standard Colors: Metal, via, poly, contact layer visualization
- Level of Detail (LOD): Intelligent prioritization for large datasets
- Batch Rendering: Optimized trace grouping for smooth interaction
- Export Options: Save visualizations as interactive HTML files
Architecture
CAP3D-Viz uses a modular architecture for optimal performance and maintainability:
cap3d_viz/
├── data_models.py # Core data structures (Block, Layer, etc.)
├── parser.py # State-machine parser with streaming support
├── visualizer.py # 3D visualization engine with caching
├── utils.py # Convenience functions and utilities
└── __init__.py # Main package interface
State-Machine Parser
- Context-Aware: Only checks relevant conditions per parsing state
- Dispatch Tables: Direct function mapping eliminates conditional chains
- Streaming Architecture: Memory-efficient line-by-line processing
- Pre-compiled Patterns: Cached operations for maximum speed
Scientific Applications
CAP3D-Viz is designed for researchers and engineers working with:
- Integrated Circuit Design: Visualization of IC layouts and parasitic structures
- Capacitance Analysis: 3D exploration of capacitive coupling effects
- EDA Tool Integration: Workflow enhancement for design automation
- Research Publications: High-quality figures for academic papers
- Design Verification: Visual validation of 3D geometry structures
Documentation
- API Reference: https://cap3d-viz.readthedocs.io/
- Tutorials: docs/tutorials/
- Examples: examples/
- Performance Guide: docs/performance.md
Testing
Run the test suite to verify installation:
# Install development dependencies
pip install -e .[dev]
# Run all tests
pytest
# Run with coverage
pytest --cov=cap3d_viz
# Run performance benchmarks
python -m cap3d_viz.benchmarks
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
git clone https://github.com/your-repo/cap3d-viz.git
cd cap3d-viz
pip install -e .[dev]
pre-commit install
Running Tests
pytest tests/
black cap3d_viz/
flake8 cap3d_viz/
mypy cap3d_viz/
📄 Citation
If you use CAP3D-Viz in your research, please cite:
@software{cap3d_viz_2025,
author = {Ahmed Ali},
title = {{CAP3D-Viz}: High-Performance {3D} Visualization for {CAP3D} Files},
version = {1.0.0},
date = {2025-07-24},
publisher = {Zenodo},
doi = {10.5281/zenodo.16406690},
url = {https://doi.org/10.5281/zenodo.16406690},
repository= {https://github.com/andykofman/RWCap_view},
type = {software}
}
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- RWCap Development Team: For the CAP3D file format specification
Support
- Issues: GitHub Issues
CAP3D-Viz: Advancing 3D visualization for integrated circuit design and capacitance analysis.
Metadata
Release files for cap3d-viz 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cap3d_viz-1.2.1.tar.gz | 36.3 kB | Without provenance | Details for cap3d_viz-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cap3d_viz-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for cap3d_viz-1.2.1-py3-none-any.whl |
Total release size: 62.1 kB
Release files / cap3d_viz-1.2.1.tar.gz
| Download URL | cap3d_viz-1.2.1.tar.gz |
|---|---|
| Size | 36.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16e5af73cec2d45f0f3145d01ae4c1600378a059b995898b94b7ba62b48d8251
|
|
BLAKE2b-256 checksum How to use checksums |
a38d2b02fde26e8a66c523f3ee933285079373cc6e78e28baef835f6b6f92c60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cap3d_viz-1.2.1-py3-none-any.whl
| Download URL | cap3d_viz-1.2.1-py3-none-any.whl |
|---|---|
| Size | 25.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4bec6b90d090996b644f7ccf55ccd4f8ba6c0f6a4f33de4f61a175b815c18ced
|
|
BLAKE2b-256 checksum How to use checksums |
b56ce58722daa4d624551a2614c85c708490ad36d7c42f8720bfc1175af233ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for cap3d-viz 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.