Open JoshuaKahn opened 3 years ago
@JoshuaKahn - are you forcing the polyline to clamp with the clampToGround
option? Currently we ignore this option if the tesselate
flag is missing.
I think whether or not the line has tessellate in the KML file determines what ArcType is chosen.
This seems accurate - see these lines in KmlDataSource.js:
if (!tessellate || canExtrude) {
polyline.arcType = ArcType.NONE;
}
@lilleyse Do you know what the correct behavior should be between ArcType
and tesselate
?
@JoshuaKahn - are you forcing the polyline to clamp with the
clampToGround
option? Currently we ignore this option if thetesselate
flag is missing.I think whether or not the line has tessellate in the KML file determines what ArcType is chosen.
This seems accurate - see these lines in KmlDataSource.js:
if (!tessellate || canExtrude) { polyline.arcType = ArcType.NONE; }
@lilleyse Do you know what the correct behavior should be between
ArcType
andtesselate
?
@ebogo1 Yes I am forcing the polyline to clamp as I've run into circumstances in the pass where KMLs I have been sent do not have tessellate enabled, meaning them easily clip into terrain. The tool I'm developing Cesium with will be used by other users, and I'm hoping that I can enable KML import into the application such that they don't have to edit any KML file they are given to have polylines clamp to terrain.
Right now I'm avoiding the resulting error mentioned above by setting polylines to use ArcType.GEODESIC
, then setting their clamp to ground value to true
.
@JoshuaKahn For now your approach might be best. We'll leave this issue open to revisit in the future - the end goal might be to add an option to KmlDataSource
that overrides clampToGround
behavior, but I'm unsure when we'll get to resolving this.
Sandcastle example: None Specifically
Browser: Chrome
Operating System: Linux (Kubuntu) 20.04
When importing a KML into Cesium, polylines will either have their ArcType value set as
undefined
orArcType.NONE
.Here's a polyline printed to the log after import.
I discovered this when trying to force polylines from Cesium to be clamped to terrain upon import. Often without the right
ArcType
value the engine will crash trying to get the line to clamp, with the error:I think whether or not the line has
tessellate
in the KML file determines what ArcType is chosen. Iftessellate
is present, then ArcType will beundefined
; if it's not, thenArcType
will beArcType.NONE
.An example KML file can be located here.