← Back to team overview

kicad-developers team mailing list archive

Re: 3D-Viewer - Request for merge evaluation

 

Few comments from a quick initial test:

1) The attached patch is required to build on at least clang+Linux. Probably
other platforms as well. Also tested on gcc+Linux to verify fixing clang
doesn't break gcc.

2) The raytracer is REALLY slow on clang builds. Takes about 10-20secs to
render with gcc, and about 20 MINUTES with clang. At least OSX depends on
clang, so this should probably be investigated. (Still haven't tested on OSX
though, I'll do that later).

3) Even at the faster speed, the raytracer is too slow and unresponsive. This
doesn't stop a merge for me, I'd be okay with merging it as long as this will
be fixed in the future. But I'd like to see one of the following changes made:

3A) Raytracer UI responsiveness improvements. Allow the user to start dragging
the PCB around even after the render has started, rather than going completely
frozen during the render. Also, continue responding to redraw events even if
you don't have anything to draw yet - just redrawing the old image would work -
as without that, the window displays graphical garbage if anything has been
dragged over the top, giving the impression that it's broken/stalled.

3B) Raytracer becomes an noninteractive output engine only. Use OpenGL for the
interactive view, and have an export option to use the raytracer to generate a
high-quality view. You could also add a "raytrace" button to the toolbar to
raytrace an individual view, and revert to GL when the view is moved again.

I haven't had a segfault yet.

On Tue, Jun 14, 2016 at 05:50:47PM +0000, Mário Luzeiro wrote:
> Hi Wayne,
> 
> As you may know, I have been working on refactoring the 3D-Viewer. I believe it is ready to be evaluated to a merge in the main KiCad branch.
> 
> At this moment it supports all the same features as the current stable version plus lots of new useful features, eye-candy and performance improvements.
> It completely takes advantage of the 3D plugin system (developed by Cirilo) that is already present in main KiCad repository.
> 
> I invite you and you are welcomed to give a try in my branch:
> https://code.launchpad.net/~mrluzeiro/kicad/kicad_new3d-viewer
> 
> The major new feature (from a user perspective) are:
> - New render targets (OpenGL and Raytracing) with expected fast loading of 3D models.
> - Shortcuts keys improved: x,y,z for orientation; t,s,v to hide/display THT,SMD,Virtual footprints; spacebar/middle mouse click to align with board (bounding box) pivot rotation. (to be documented)
> - On pcbnew, footprint 3D Settings, it is possible to adjust the 3D model and the footprint with a preview of the footprint board on a realtime WYSIWYG fashion.
> 
> I am not adding new features for some months now, just keep it updated with main branch, some bug fixing and housekeeping.
> My branch is being used by me and at least by Cirilo and Maurice that actively send me feedback and helped testing it. There are other users that already tried it from the foruns.
> 
> So I am now looking into you as I consider it is ready to be evaluated to be merged in the main KiCad branch.
> I am looking if you can start this evaluation and let me know any work it may still need before you feel it is ok to be merged.
> 
> I scanned already my branch with -wshadow and Cppcheck fixing the most important warnings.
> I plan to have availability on the next months to give support into this merge process and fix any possible bugs.
> 
> I have in mind other additions and improvements but I am holding it since I would like first that, this work I did so far, can be integrated.
> The next things I am planning would be small progressive additions and I will look to discuss it here in the list before implement it.
> 
> I hope you can give it a try and I will be waiting for your feedback and guidelines on any changes needed.
> 
> 
> I left here some screenshots (raytracing renders) of a project I am working that require some kind of mechanical validation. I use both VRML files (converted from STEPS to WRL using Maurice FreeCAD exporter) and some STEP files (using out-of-the-tree OCE plugin by Cirilo)
> 
> https://meocloud.pt/link/14febff7-0868-4671-a9e6-93386ebbdf44/20160614/
> 
> 
> Thanks in advance!
> 
> Regards,
> Mario Luzeiro
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>From ef36fc2d691b9f93fda0775870432f520c0b1ded Mon Sep 17 00:00:00 2001
From: Chris Pavlina <pavlina.chris@xxxxxxxxx>
Date: Tue, 14 Jun 2016 15:09:34 -0400
Subject: [PATCH] 3D: add missing includes

---
 3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.cpp | 3 ++-
 3d-viewer/trackball.h                                                  | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.cpp
index b93165e..d39a6d1 100644
--- a/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.cpp
+++ b/3d-viewer/3d_rendering/3d_render_raytracing/accelerators/cbvh_pbrt.cpp
@@ -2,7 +2,7 @@
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
  * Copyright (C) 2015 Mario Luzeiro <mrluzeiro@xxxxx>
- * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -74,6 +74,7 @@
 
 #include <stack>
 #include <wx/debug.h>
+#include <mm_malloc.h>
 
 #ifdef PRINT_STATISTICS_3D_VIEWER
 #include <stdio.h>
diff --git a/3d-viewer/trackball.h b/3d-viewer/trackball.h
index a860dff..964b71d 100644
--- a/3d-viewer/trackball.h
+++ b/3d-viewer/trackball.h
@@ -40,6 +40,8 @@
  * Written by Gavin Bell for Silicon Graphics, November 1988.
  */
 
+#include <GL/gl.h>
+
 /*
  * Pass the x and y coordinates of the last and current positions of
  * the mouse, scaled so they are from (-1.0 ... 1.0).
-- 
2.8.3


Follow ups

References