Skip to content

Rendering issue in Orthogonal mode #364

@xarthurx

Description

@xarthurx

Perspective

Image

Orthogonal

Image
"""
Test script to verify polyscope radius rendering behavior.
Tests if polyscope interprets radius as radius or diameter.
"""

import numpy as np
import polyscope as ps


def test_radius_rendering():
  """Test how polyscope interprets the radius parameter."""

  # Initialize polyscope
  ps.init()
  ps.remove_all_structures()
  ps.set_up_dir("z_up")
  ps.set_ground_plane_height(0.0)
  ps.set_ground_plane_mode("shadow_only")

  print("=" * 70)
  print("Polyscope Radius Rendering Test")
  print("=" * 70)

  # Test 1: Simple cylinder - 200mm radius, 200mm length
  # In meters: 0.2m radius, 0.2m length
  print("\nTest 1: 200mm radius cylinder, 200mm long")
  print("  Creating curve from (0,0,0) to (0.2,0,0) with radius=0.2")

  nodes_1 = np.array(
    [
      [0.0, 0.0, 0.0],  # Start point
      [0.0, 4.0, 0.0], 
    ]
  )
  edges_1 = np.array([[0, 1]])

  ps.register_curve_network(
    "Test1_radius_0.1m",
    nodes_1,
    edges_1,
    enabled=True,
    radius=1,  # 20mm = 0.02m
  )

  print("  Expected visual diameter: 40mm (0.04m)")
  print("  If it looks 20mm diameter, polyscope uses radius correctly Ô£ô")
  print("  If it looks 40mm diameter, polyscope interprets radius as diameter Ô£ù")

  print("Observation:")
  print("  If red cylinder diameter equals its length (200mm),")
  print("  then polyscope uses RADIUS parameter correctly.")
  print("=" * 70)

  # Show the visualization
  ps.show()


if __name__ == "__main__":
  test_radius_rendering()

I'm running it in Python.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions