Skip to content

Commit 7fb9fcc

Browse files
committed
Merge branch 'feature/v0.4.5' into develop
2 parents d745625 + 4577a99 commit 7fb9fcc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

colour/geometry/section.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ def hull_section(
244244
section = trimesh.intersections.mesh_plane(hull, normal, plane)
245245
if len(section) == 0:
246246
raise ValueError(f'No section exists on "{axis}" axis at {origin} origin!')
247+
247248
section = close_chord(unique_vertices(edges_to_chord(section)))
248249

249250
return section

colour/plotting/section.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,10 @@ def plot_RGB_colourspace_section(
549549
axis: Literal["+z", "+x", "+y"] | str = "+z",
550550
origin: float = 0.5,
551551
normalise: bool = True,
552+
size: float = 1.0,
552553
show_section_colours: bool = True,
553554
show_section_contour: bool = True,
555+
segments: int = 64,
554556
**kwargs: Any,
555557
) -> Tuple[Figure, Axes]:
556558
"""
@@ -571,10 +573,15 @@ def plot_RGB_colourspace_section(
571573
Coordinate along ``axis`` at which to plot the hull section.
572574
normalise
573575
Whether to normalise ``axis`` to the extent of the hull along it.
576+
size:
577+
Size of the underlying *RGB* colourspace cube; used for plotting HDR
578+
related sections.
574579
show_section_colours
575580
Whether to show the hull section colours.
576581
show_section_contour
577582
Whether to show the hull section contour.
583+
segments
584+
Edge segments count for the *RGB* colourspace cube.
578585
579586
Other Parameters
580587
----------------
@@ -617,8 +624,8 @@ def plot_RGB_colourspace_section(
617624
first_item(filter_RGB_colourspaces(colourspace).values()),
618625
)
619626

620-
vertices, faces, _outline = primitive_cube(1, 1, 1, 64, 64, 64)
621-
XYZ_vertices = RGB_to_XYZ(vertices["position"] + 0.5, colourspace)
627+
vertices, faces, _outline = primitive_cube(1, 1, 1, segments, segments, segments)
628+
XYZ_vertices = RGB_to_XYZ((vertices["position"] + 0.5) * size, colourspace)
622629
hull = Trimesh(XYZ_vertices, faces, process=False)
623630

624631
if show_section_colours:

0 commit comments

Comments
 (0)