Skip to content

Commit 3b2ea2a

Browse files
committed
prepare for release
1 parent b75b540 commit 3b2ea2a

File tree

6 files changed

+101
-17
lines changed

6 files changed

+101
-17
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
Release history
22
===============
33

4-
v0.7.1 - not released
5-
---------------------
4+
`v0.7.1`_ - 2020-04-11
5+
----------------------
66

77
Added
88
~~~~~
99

1010
- set/release gimbal lock in camera rotations
11+
- geometry scaling by vector and w.r.t. provided point
12+
- sub-launch loop breaking on UI events (e.g. camera rotation)
1113

1214
Fixed
1315
~~~~~
1416

1517
- nan's in mesh normal calculatons
1618
- improved bvh memory allocations can handle more primitives in data sets
19+
- texture values prescale when gamma is 1.0
1720

1821
`v0.7.0`_ - 2020-03-27
1922
----------------------
@@ -294,6 +297,7 @@ v0.1.2.5 - 2019-04-16
294297

295298
Two weeks and some steps from the initial release. Starting changelog relative to this point.
296299

300+
.. _`v0.7.1`: https://github.com/rnd-team-dev/plotoptix/releases/tag/v0.7.1
297301
.. _`v0.7.0`: https://github.com/rnd-team-dev/plotoptix/releases/tag/v0.7.0
298302
.. _`v0.5.2`: https://github.com/rnd-team-dev/plotoptix/releases/tag/v0.5.2
299303
.. _`v0.5.1`: https://github.com/rnd-team-dev/plotoptix/releases/tag/v0.5.1

plotoptix/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
__author__ = "Robert Sulej, R&D Team <dev@rnd.team>"
1414
__status__ = "beta"
1515
__version__ = "0.7.1"
16-
__date__ = "6 April 2020"
16+
__date__ = "11 April 2020"
1717

1818
import logging
1919

plotoptix/_load_lib.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,24 @@ def _load_optix_win():
220220
optix.scale_primitive.argtypes = [c_wchar_p, c_long, c_float, c_bool]
221221
optix.scale_primitive.restype = c_bool
222222

223+
optix.scale_geometry_c.argtypes = [c_wchar_p, c_float, c_float, c_float, c_float, c_bool]
224+
optix.scale_geometry_c.restype = c_bool
225+
226+
optix.scale_primitive_c.argtypes = [c_wchar_p, c_long, c_float, c_float, c_float, c_float, c_bool]
227+
optix.scale_primitive_c.restype = c_bool
228+
229+
optix.scale_geometry_xyz.argtypes = [c_wchar_p, c_float, c_float, c_float, c_bool]
230+
optix.scale_geometry_xyz.restype = c_bool
231+
232+
optix.scale_primitive_xyz.argtypes = [c_wchar_p, c_long, c_float, c_float, c_float, c_bool]
233+
optix.scale_primitive_xyz.restype = c_bool
234+
235+
optix.scale_geometry_xyz_c.argtypes = [c_wchar_p, c_float, c_float, c_float, c_float, c_float, c_float, c_bool]
236+
optix.scale_geometry_xyz_c.restype = c_bool
237+
238+
optix.scale_primitive_xyz_c.argtypes = [c_wchar_p, c_long, c_float, c_float, c_float, c_float, c_float, c_float, c_bool]
239+
optix.scale_primitive_xyz_c.restype = c_bool
240+
223241
optix.update_geom_buffers.argtypes = [c_wchar_p, c_uint]
224242
optix.update_geom_buffers.restype = c_bool
225243

@@ -727,6 +745,18 @@ def scale_geometry(self, name, s, update): return self._optix.scale_geometry(nam
727745

728746
def scale_primitive(self, name, idx, s, update): return self._optix.scale_primitive(name, idx, s, update)
729747

748+
def scale_geometry_c(self, name, s, cx, cy, cz, update): return self._optix.scale_geometry_c(name, s, cx, cy, cz, update)
749+
750+
def scale_primitive_c(self, name, idx, s, cx, cy, cz, update): return self._optix.scale_primitive_c(name, idx, s, cx, cy, cz, update)
751+
752+
def scale_geometry_xyz(self, name, x, y, z, update): return self._optix.scale_geometry_xyz(name, x, y, z, update)
753+
754+
def scale_primitive_xyz(self, name, idx, x, y, z, update): return self._optix.scale_primitive_xyz(name, idx, x, y, z, update)
755+
756+
def scale_geometry_xyz_c(self, name, x, y, z, cx, cy, cz, update): return self._optix.scale_geometry_xyz_c(name, x, y, z, cx, cy, cz, update)
757+
758+
def scale_primitive_xyz_c(self, name, idx, x, y, z, cx, cy, cz, update): return self._optix.scale_primitive_xyz_c(name, idx, x, y, z, cx, cy, cz, update)
759+
730760
def update_geom_buffers(self, name, mask): return self._optix.update_geom_buffers(name, mask)
731761

732762
def set_coordinates_geom(self, mode, thickness): return self._optix.set_coordinates_geom(mode, thickness)

plotoptix/bin/RnD.SharpOptiX.dll

7.5 KB
Binary file not shown.

plotoptix/bin/rndSharpOptiX7.dll

0 Bytes
Binary file not shown.

plotoptix/npoptix.py

Lines changed: 64 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4122,7 +4122,8 @@ def rotate_primitive(self, name: str, idx: int, rot: Tuple[float, float, float],
41224122
self._logger.error(msg)
41234123
if self._raise_on_error: raise RuntimeError(msg)
41244124

4125-
def scale_geometry(self, name: str, s: float,
4125+
def scale_geometry(self, name: str, s: Union[float, Tuple[float, float, float]],
4126+
center: Optional[Tuple[float, float, float]] = None,
41264127
update: bool = True) -> None:
41274128
"""Scale all primitive's positions and sizes.
41284129
@@ -4136,19 +4137,44 @@ def scale_geometry(self, name: str, s: float,
41364137
----------
41374138
name : string
41384139
Name of the geometry.
4139-
s : float
4140-
Scaling factor.
4140+
s : float, tuple (float, float, float)
4141+
Scaling factor, single value or (x, y, z) scales.
4142+
center : tuple (float, float, float), optional
4143+
Scaling center. If not provided, scaling is made w.r.t. the primitive center.
41414144
update : bool, optional
41424145
Update GPU buffer.
41434146
"""
41444147
if name is None: raise ValueError()
41454148

4146-
if not self._optix.scale_geometry(name, s, update):
4147-
msg = "Geometry scale failed."
4148-
self._logger.error(msg)
4149-
if self._raise_on_error: raise RuntimeError(msg)
4149+
if isinstance(s, float) or isinstance(s, int):
4150+
s = float(s)
4151+
if center is None:
4152+
if not self._optix.scale_geometry(name, s, update):
4153+
msg = "Geometry scale by scalar failed."
4154+
self._logger.error(msg)
4155+
if self._raise_on_error: raise RuntimeError(msg)
4156+
else:
4157+
if not isinstance(center, tuple): center = tuple(center)
4158+
if not self._optix.scale_geometry_c(name, s, center[0], center[1], center[2], update):
4159+
msg = "Geometry scale by scalar w.r.t. the center failed."
4160+
self._logger.error(msg)
4161+
if self._raise_on_error: raise RuntimeError(msg)
4162+
else:
4163+
if not isinstance(s, tuple): s = tuple(s)
4164+
if center is None:
4165+
if not self._optix.scale_geometry_xyz(name, s[0], s[1], s[2], update):
4166+
msg = "Geometry scale by vector failed."
4167+
self._logger.error(msg)
4168+
if self._raise_on_error: raise RuntimeError(msg)
4169+
else:
4170+
if not isinstance(center, tuple): center = tuple(center)
4171+
if not self._optix.scale_geometry_xyz_c(name, s[0], s[1], s[2], center[0], center[1], center[2], update):
4172+
msg = "Geometry scale by vector w.r.t. the center failed."
4173+
self._logger.error(msg)
4174+
if self._raise_on_error: raise RuntimeError(msg)
41504175

4151-
def scale_primitive(self, name: str, idx: int, s: float,
4176+
def scale_primitive(self, name: str, idx: int, s: Union[float, Tuple[float, float, float]],
4177+
center: Optional[Tuple[float, float, float]] = None,
41524178
update: bool = True) -> None:
41534179
"""Scale selected primitive.
41544180
@@ -4164,17 +4190,41 @@ def scale_primitive(self, name: str, idx: int, s: float,
41644190
Name of the geometry.
41654191
idx : int
41664192
Primitive index.
4167-
s : float
4168-
Scaling factor.
4193+
s : float, tuple (float, float, float)
4194+
Scaling factor, single value or (x, y, z) scales.
4195+
center : tuple (float, float, float), optional
4196+
Scaling center. If not provided, scaling is made w.r.t. the primitive center.
41694197
update : bool, optional
41704198
Update GPU buffer.
41714199
"""
41724200
if name is None: raise ValueError()
41734201

4174-
if not self._optix.scale_primitive(name, idx, s, update):
4175-
msg = "Primitive scale failed."
4176-
self._logger.error(msg)
4177-
if self._raise_on_error: raise RuntimeError(msg)
4202+
if isinstance(s, float) or isinstance(s, int):
4203+
s = float(s)
4204+
if center is None:
4205+
if not self._optix.scale_primitive(name, idx, s, update):
4206+
msg = "Primitive scale by scalar failed."
4207+
self._logger.error(msg)
4208+
if self._raise_on_error: raise RuntimeError(msg)
4209+
else:
4210+
if not isinstance(center, tuple): center = tuple(center)
4211+
if not self._optix.scale_primitive_c(name, idx, s, center[0], center[1], center[2], update):
4212+
msg = "Primitive scale by scalar w.r.t. the center failed."
4213+
self._logger.error(msg)
4214+
if self._raise_on_error: raise RuntimeError(msg)
4215+
else:
4216+
if not isinstance(s, tuple): s = tuple(s)
4217+
if center is None:
4218+
if not self._optix.scale_primitive_xyz(name, idx, s[0], s[1], s[2], update):
4219+
msg = "Primitive scale by vector failed."
4220+
self._logger.error(msg)
4221+
if self._raise_on_error: raise RuntimeError(msg)
4222+
else:
4223+
if not isinstance(center, tuple): center = tuple(center)
4224+
if not self._optix.scale_primitive_xyz_c(name, idx, s[0], s[1], s[2], center[0], center[1], center[2], update):
4225+
msg = "Primitive scale by vector w.r.t. the center failed."
4226+
self._logger.error(msg)
4227+
if self._raise_on_error: raise RuntimeError(msg)
41784228

41794229
def update_geom_buffers(self, name: str,
41804230
mask: Union[GeomBuffer, str] = GeomBuffer.All) -> None:

0 commit comments

Comments
 (0)