Compare commits

...

2 Commits

View File

@ -325,6 +325,7 @@ class RasterView:
obj.ViewObject.ShapeMaterial.EmissiveColor = props[5]
obj.ViewObject.LineWidth = props[6]
obj.ViewObject.DisplayMode = props[7]
obj.ViewObject.PointMaterial.Transparency = 0
# remove the temporary document
if close_tmp_doc:
@ -403,6 +404,8 @@ class RasterView:
configured.append(obj)
if self._should_render(obj) and not fast_render:
obj.ViewObject.DisplayMode = 'Flat Lines'
obj.ViewObject.PointMaterial.Transparency = 1.0 # hide points
obj.ViewObject.LineColor = (0.0, 0.0, 1.0, 0.0) if link in parts else (1.0, 0.0, 1.0)
obj.ViewObject.ShapeMaterial.AmbientColor = (0.0, 0.0, 0.0, 0.0)
obj.ViewObject.ShapeMaterial.DiffuseColor = (0.0, 0.0, 0.0, 0.0)
@ -509,13 +512,14 @@ class RasterView:
])
# set clip color
clip_color = (0.5, 0.5, 0.5)
colorized_clip_img = Image.merge("RGB", [
clip_img.point(lambda p: int(clip_color[0] * (255.0 - p))),
clip_img.point(lambda p: int(clip_color[1] * (255.0 - p))),
clip_img.point(lambda p: int(clip_color[2] * (255.0 - p)))
])
result.paste(colorized_clip_img, clip_img.point(lambda p: 255 - p))
if not fast_render:
clip_color = (0.5, 0.5, 0.5)
colorized_clip_img = Image.merge("RGB", [
clip_img.point(lambda p: int(clip_color[0] * (255.0 - p))),
clip_img.point(lambda p: int(clip_color[1] * (255.0 - p))),
clip_img.point(lambda p: int(clip_color[2] * (255.0 - p)))
])
result.paste(colorized_clip_img, clip_img.point(lambda p: 255 - p))
# crop 1px borders
result = result.crop((1, 1, result.size[0] - 1, result.size[1] - 1))