In a past life I was a kernel engineer on Parasolid the numerical heart within many top CAD applications such Ansys Workbench, Dassault Solidworks, Siemens NX and Solid Edge, Bentley, Nemetscheck, Missler Top Solid; I lived, breathed and obsessed about CAD workflows, how users construct parts and use CAD applications. Now I’m in Cloud computing and VDI, I still get to work with CAD applications but am working in an industry where for many other than the customer – a CAD application is just another VDI or virtualised app or workload.
Thankfully Citrix saw sense to employ some people (including me) who know a bit about CAD and how these workloads and the user workflows around the software are vastly different to the demands of an office application such as Word or a browser viewing You-tube. In our development and test of HDX we take extreme care with key workflows like hidden-line viewing. If you understand hidden-line CAD use then you can expose the cracks in a lot of remote graphics “solutions” hidden by clever or carefully chosen demos.
What is hidden-line view in CAD?
Hidden-line is one of the most widely favoured viewers favoured by designers used hour-in-hour-out, day-in-day-out. Sometimes people erroneously refer to hidde-line as wireframe modes but they are very different. Most CAD applications (Solidworks, AutoDesk AutoCAD and REVIT, Siemens NX etc) will have a selection of views, see the Solidworks help for an example.
Hidden-line will look something like this:
Where you can see:
- Lines on edges you would be able to see are solid
- Lines on edges you wouldn’t see if the part was solid are dashed
- On many parts different parts will be coloured differently too
Designers like hidden-line because they can see all the edge topology of a part easily, if you look at a rendered part particular where a line is between two smooth surfaces the reflections and surface can be confusing. Below the cylindrical face (in red) has two long edges between surfaces that meet smoothly:
How hidden-line data is constructed
The geometry on the edges depends on the sophistication of the CAD application. In general low-end CAD solutions use more simple geometry (lines, circles, cylinders, planes) whereas high-end CAD packages often rely on high-order NURBS. Tolerant modellers where geometry has uncertainty adds complexity. Geometry on edges often results from intersections associated with the two surfaces on the neighbouring faces and with smooth edges this can get complex (in the above the cylinder and the plane intersect on the smooth edge but working out intersections between two tangential things is numerically intensive). After all the geometry is worked out for all the edges, those lines are then projected and the intersections worked out in the projection and essentially splits the lines where the intersections are, the modeller then also works out whether all the little split sections are in the view or behind others. This is very numerically intensive on a modeller and generates a lot of data and uses a lot of compute power even before anything is rendered. Every time a user moves a part a little bit, all that data has to be recalculated. The geometry in many CAD packages is often double-precision with an accuracy down to 10e-14 on parts ranging typically from 1.0e3 to 1.0e-8.
True wire frame just regards all the lines as the same and projects them to make an image, a lot less work!
Once the hidden-lines are constructed they are usually rendered onto the screen. For remoting of this data this type of view is in particular very challenging. CAD line data is the anti-thesis of what video codecs like H.264 are designed to work best with. Additionally these fairly simple images are also the type of image least well suited to compression, the compression ratios achievable are low compared to most visual images and the effects of artefacts are more likely to be prominent to the user.
Most demos usually feature the prettiest CAD images, rather than boring hidden-line, with some sort of shaded or rendered view e.g.
It may seem counter-intuitive but this type of view is actually a lot gentler on the CAD application and also remoting. Typically CAD applications will generate a facetted representation of a CAD part (a model made of small triangles), often this will be lightweight single precision data (see NX lightweight faceting). Once calculated this one facetted mesh is used when the part is moved, typically just projecting the triangles and processing them through shaders or similar, typically optimised to render such things. Additionally the end screen is better suited to remoting codecs such as H.264, being more photographic like. The fact lines probably aren’t crisp is completely hidden by the complexity of the view.
Don’t be fooled by faceting and shaders!
Many CAD applications don’t actually use a lot of GPU but a lot of CPU. If you are looking to evaluate remoting technologies for CAD I would recommend you use an application such as CATIA, Siemens NX or Solidworks known to use the GPU and CPU heavily. Some applications such as AutoCAD were being successfully remoted by Citrix and partners like IMSCAD before GPU acceleration was possible for remote applications, so unless used in newer demanding modes of operation AutoCAD in a remoting demo can be misleading as to the general capacity of the hardware to remote other CAD applications.
Most demos/key notes I have seen tend to show a rotating, panning shot of a shiny, pretty rendered car and if they switch to another view it’s usually a pure wireframe view. I have yet to see a sales demo using hidden-line view in a keynote or similar.
Scrutinise H.264 technologies very closely with hidden-line data
H.264 is fundamentally weakest on hidden-line data (read here – why and why Citrix does more than H.264 – here), particularly the most common default YUV 4:2:0. To get it up to quality may require additional bandwidth or techniques. In particular H.264 artefacts are particularly nasty and offensive to CAD users:
- lines slightly less sharp
- near parallel lines slightly distorted
Near parallel lines are hard to calculate intersection between so again load a server when using hidden line and they are the thing large numbers of CAD users care most about. A long time ago I wrote a blog about benchmarking CAD, where I highlighted several key workflows (read it here), including technologies such as synchronous technology but also basic picking an edge tests (Josh Mings made some really astute observations on usability over on the solidsmack CAD site and suggested using “the selection test”).
I have seen plenty of dubious demonstrators/tests that various technologies are great for CAD, my thoughts are that:
- Rotating a large part at a constant speed in CATIA is not what most CAD users do! Zooming and picking lines in hidden-line data is far more common.
- Playing 5 copies of Google Earth or Youtube does not demonstrate a system is suitable for CAD graphics remoting.
- For some applications – high-end CAD, Petrel, Geo data applications –The Framebuffer of the GPU can become a critical bottleneck and the framebuffer usage can be very different to office applications or AutoCAD.
- Comparisons, some remoting solutions look fine viewed alone but when you compare them side-by-side you start seeing tricks (see the infamous dark shadows benchmark – here).
It’s very easy to avoid the weaknesses and dazzle users with rapidly moving, highly visual images in demos but the CAD user day-to-day cares what happens on “simple” line views and when you slow down.
Build-to-lossless and lossless technologies
H.264 (particularly YUV 4:2:0 format) is weak on line data, particularly static data, Citrix have invested in a number of strategies to benefit CAD users and overcome the limitations they will encounter with out-of-the-box H.264 protocol vendors. We are continuing to focus on this area and I’d expect to see further enhancements.
Citrix like most vendors proves a true lossless mode that remotes every pixel exactly. This is very costly on bandwidth and when dealing with large CAD parts one to avoid unless you have very generous bandwidth to burn.
H.264 YUV 4:4:4 (Visually lossless modes)
H.264 YUV 4:4:4 is much better on hidden-line like data than the industry standard YUV 4:2:0 but it will use approximately twice the bandwidth and on moving data (like rotating CAD parts, scrolling webpages) the benefits are negligible. There are some details on how to turn on “Visually Lossless” mode and how to check you are using it, on an older blog of mine – here.
Build-to-lossless and Build-to-Visually lossless
These are modes where moving data, video / rotating CAD parts is transmitted at a lower quality where the benefits to the human eye are negligible but sharpens up when the screen stops moving e.g. you stop rotating your CAD part. How fast and well this is done greatly affects user experience. Ensuring the screen doesn’t pause whilst the sharpening occurs is key, otherwise the user feels a freeze, may start trying to move a part again and then the session can judder/shudder/jerk. The needs of the interactive 3D/Cad user and how build-to-lossless should respond is very different to the video users expectation and as such the technologies in our newest graphics mode “Thinwire Compatibility” (Thinwire plus) handle these cases differently. I was particularly pleased to see comments on Muhammad’s blogs from real CAD users using these new technologies and their comments on hidden-line (read real user opinions here – and how to turn on this new mode), really satisfying to see comments including reference to hidden-line:
- “Wire frame models, with hidden lines, is just the view option within revit that would be most commonly used. Shaded is an another option, for example. But wireframe with hidden lines is by far the most common. The feedback on this so far is that it resolution performance is excellent.”.
Another user has written about his experiences with the build-to-loss functionality in Thinwire Compatibility – worth a read, here.
Switching manually between lossy and lossless modes
CAD users are methodical and like control – some users prefer to control their own lossless work flows and we have added a hotkey to XenDesktop/XenApp 7.6 FP3 that allows users control over hotkeys to toggle between lossy and lossless imaging, a snap-to-lossless functionality – read more here.
You probably only need to use one technique to handle hidden-line!
We have provided lots of options as we recognise it is such an important workflow to get sharp hidden-line data. For the majority of users I would try Thinwire Compatibility as an initial strategy if users are sensitive to H.264 artefacts. Users should regard other techniques as alternative (“OR”) strategy rather than set more and more options.
Details like this is why Citrix is so fortunate to have someone with your knowledge as the HDX graphics manager!
LikeLiked by 1 person