question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Drill picking polygons causes browser to hang

See original GitHub issue

After upgrading from 1.38 to 1.39, drill picking certain polygons causes the browser to hang in an infinite loop at this spot in the code.

After quite a bit of debugging, I discovered that this happens on polygons that are missing a height attribute, even though the API says it’s an optional property. To fix the issue in 1.39 apps, you can explicitly set the height of all polygons to 0.0 (the default). This isn’t really a true workaround though, as your polygon will no longer conform to the terrain as it did when you completely omitted the property.

For example, drill-picking the polygon in this Sandcastle example will result in the browser hanging. Add in height: 0.0 and the drill picker will work again (albeit underground if you have terrain enabled).

var viewer = new Cesium.Viewer('cesiumContainer');

var wyoming = viewer.entities.add({
  name : 'Wyoming',
  show: true,
  polygon : {
    hierarchy : Cesium.Cartesian3.fromDegreesArray([
                              -109.080842,45.002073,
                              -105.91517,45.002073,
                              -104.058488,44.996596,
                              -104.053011,43.002989,
                              -104.053011,41.003906,
                              -105.728954,40.998429,
                              -107.919731,41.003906,
                              -109.04798,40.998429,
                              -111.047063,40.998429,
                              -111.047063,42.000709,
                              -111.047063,44.476286,
                              -111.05254,45.002073]),
    material : Cesium.Color.RED.withAlpha(0.5)
  }
});

viewer.screenSpaceEventHandler.setInputAction(function (movement) {
	var picks = viewer.scene.drillPick(movement.position);
	if (Cesium.defined(picks)) {
		console.log(picks.length);
	}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);

viewer.zoomTo(wyoming);

EDIT: This applies to other primitives too – not just polygons.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
juburrcommented, Nov 8, 2017
1reaction
pjcozzicommented, Nov 8, 2017

Good eye, thanks @jburr-nc!

@bagnell please look at this for the next release.

@jburr-nc it may be a week or two before we can get to this so feel free to dig even farther in the meantime if you want 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Polygon Component Tools - Foundry Learn
Scales a selected polygon on a mesh item and detaches it. Flattens Ngons in a model that are not planar. Splits a selected...
Read more >
To Use the Control Polygon Option - PTC Support
To Use the Automatic Chamfer Selection · Example: Automatic Chamfer Selection · About Web Drilling · To Define Plates for Web Drilling.
Read more >
Macaos Enterprise 4.x | Macaos
0003976: [Import] Drill parser fails on block with M08M30 ... 0003895: [Panelization] Rigid board with outer rout diameter < 1mm causes program to...
Read more >
Rendering big geodata on the fly with GeoJSON-VT | by Mapbox
Could we create vector tiles on the fly, in the browser? Specifically for this purpose, I wrote a new JavaScript library — geojson-vt....
Read more >
Getting Started with BD FACSDiva Software
Modified: Creating an Experiment, Working With Experiments in the Browser, Importing Data, ... Proportional resizing of polygon and rectangular gates.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found