3

I am trying to use the sectioning tool on STEP files created in Solidworks and OnShape, and am seeing really thick lines along the edges of the part at the section. I tried the newest viewer release (6.1) and am still experiencing the issue. See the following screenshot:

STEP File Section Graphical Issue

This isn't specific to STEP files, I am also seeing it (to a much lesser extent) with native SLDPRT and Creo files, for example.

Wondering if anyone else has experienced this problem, and if there's a way to account for / mitigate it client side?

  • Hi Jeremy, I remember this issue from when I was a developer on the viewer. It's one of the notorious bugs that were, and probably still are, very hard to figure out for all edge cases (making sure an arbitrary 3D line is projected with certain pixel width, making it anti-aliased at the same time, etc.). – Petr Broz Sep 06 '18 at 09:05
  • I'm afraid there's no universal solution to this issue at the moment, other than perhaps hacking on the section tool itself and disabling the outline entirely (commenting out the `section.add(section2D);` line in the section tool's [implementation](https://developer.api.autodesk.com/modelderivative/v2/viewers/extensions/Section/Section.js)). – Petr Broz Sep 06 '18 at 09:06
  • Thanks for the response @PetrBroz. That sounds like a decent work around for now - going to give it a shot. Looks like that link is broken. Do you know where to find that in the new documentation? – Jeremy Andrews Sep 06 '18 at 13:48
  • Is the link not working for you? It's the JavaScript implementation of the section tool, just to get an idea about how it works. Unfortunately there isn't much documentation for these extensions - it's not expected that people would be hacking on their internals. – Petr Broz Sep 06 '18 at 14:15
  • Btw. I've realized there's one more (still hacky) way to disable the section outline. I'll post it in an answer to your question. – Petr Broz Sep 06 '18 at 14:16
  • Awesome, thank you. Yeah I am getting a "Page can't be found" error. I can't seem to find a copy of the section.js extension file anywhere. There are a bunch [here](https://github.com/Autodesk-Forge/forge-rcdb.nodejs/tree/master/src/client/viewer.components/Viewer.Extensions.Dynamic) but yeah they don't seem to make the core extensions available anymore. I'm assuming the way to do what you've described is to create our own section extension js file with that change and replace the default one in the viewer menu? Or is there another way of going about this? – Jeremy Andrews Sep 06 '18 at 14:34

1 Answers1

2

As discussed under the original question, this is a known and difficult bug in the viewer. There's currently no official way to disable the section outline, but you could do that with a bit of hacking and kung fu:

// get the scene containing the section geometry
let section = NOP_VIEWER.impl.sceneAfter.getObjectByName("section");
let area = section.children[0]; // this is the hatched section area
let outline = section.children[1]; // this is the outline that's causing problems
section.remove(outline);

One downside of this approach is that you'd have to run this piece of code whenever the section is recreated, for example, on each cutplanes-change-event event.

Hope that helps.

Petr Broz
  • 8,891
  • 2
  • 15
  • 24
  • 1
    Amazing - this worked! Thanks. I think it is a fine work around for now, and we will investigate how better to handle this. – Jeremy Andrews Sep 06 '18 at 14:41