Cesium 关于裁切官方回复

cesium 区域裁剪、局部渲染 实现如题功能,需要用到cesium的ClippingPlaneCollection与ClippingPlane接口。其中ClippingPlane用于定义裁剪平面,ClippingPlaneCollection则是ClippingPlane的集合。一般来说,我们需要多个裁剪面的协作配合才能实现理想的效果。 上述代码是cesium沙盒中的例子,参数 modelMatrix为裁剪面集合的模型矩阵,要想定位到自定义位置,其值应为 参数planes为ClippingPlane的集合,后续讲解 这俩参数的作用好像对本 阅读详情

暂时不支持凹多边形、多个裁切的

Q1 Multiple ClippingPlaneCollections for concave clipping polygons

https://community.cesium.com/t/multiple-clippingplanecollections-for-concave-clipping-polygons/6479
Hi everyone
I find that clipping planes for globe and models can only cut a convex area.
What if I have a concave shape to clip?
My solution is to apply multiple clippingPlaneCollections.
So that I can triangulate the concave shape into triangles first, and then clip the area triangle by triangle with multiple clippingPlaneCollections.
However, modifying the source code is a little bit hard for me.
Can any help me with the idea?
Thanks
Chris

A1 Currently its not possible to have multiple clippingPlane 1Collections.

Hi,
Currently its not possible to have multiple multiple clippingPlane Collections. We have started some work on clipping volumes, which you would be able to have multiples of per tileset, and either use a concave ro convex mode. Keep and eye out for that feature.
You can also try setting clippingPlaneCollection.unionClippingRegions 8 to false, which will clip all regions outside any clipping plane.
Thanks,
Gabby

Q2 How to clipping multiple Polygon on the Cesium3DTileset?

https://community.cesium.com/t/how-to-clipping-multiple-polygon-on-the-cesium3dtileset/9182

  1. A concise explanation of the problem you’re experiencing.
    I want to clipping multiple Polygon on Cesium3DTileset, but now I can only clipping one.
  2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
    url: tiles.url,
    clippingPlanes: [
        new Cesium.ClippingPlaneCollection({    // clipping one Polygon
            planes: [
                new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 1.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, -1.0, 0.0), -1.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0.0), 1.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0.0), -1.0)
            ],
            unionClippingRegions: false,
        }),
        new Cesium.ClippingPlaneCollection({     // clipping two Polygon
            planes: [
                new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), 2.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, -1.0, 0.0), -2.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0.0), 2.0),
                new Cesium.ClippingPlane(new Cesium.Cartesian3(-1.0, 0.0, 0.0), -2.0)
            ],
            unionClippingRegions: false,
        })
    ]
}));
  1. Context. Why do you need to do this? We might know a better way to accomplish your goal.
    I want to clip multiple polygons in Cesium3DTileset,Used to display the pipeline model below.
  2. The Cesium version you’re using, your operating system and browser.
    1.66
    在这里插入图片描述

A2 It isn’t currently possible to add multiple clipping planes to one tileset

It isn’t currently possible to add multiple clipping planes to one tileset, but we’ve got a feature request for this here: https://github.com/CesiumGS/cesium/issues/8751 35.

Q3 Add support for concave /convex clipping planes + holes in CesiumJS

https://github.com/CesiumGS/cesium/issues/8751
https://community.cesium.com/t/multiple-clippingplanes/11809

The user should be able to define a 2D clipping polygon with zero or more holes.
We should support:
Multiple clipping planes
Multiple holes in each clipping plane
Overlapping holes
We should disallow:
Self-intersecting polygons / holes
Holes that extend beyond the region of their parent clipping plane.

A3 I urgently need multiple clipping on the globe!. Here is a simple effect I achieved.

These files are modified: GlobeSurfaceShaderSet.js, GlobeSurfaceTileProvieder.js, Globe.js, GlobeVS.glsl.
New files are created: MultiClippingPlaneCollection.js, getMultiClippingFunction.js.
files.zip

You can now clip multiple polygons on the globe by passing an instance of MultiClippingPlaneCollection which manages a list of ClippingPlaneCollection to the multiClippingPlanes property new added to the globe.

For example:

var clippingPlanecollection1 = new Cesium.ClippingPlaneCollection({
      planes: [
        new Cesium.ClippingPlane(new Cesium.Cartesian3(1.0, 0.0, 0.0), 0.0),
        new Cesium.ClippingPlane(
          new Cesium.Cartesian3(-1.0, 0.0, 0.0),
          -500.0
        ),
        new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), -15.0),
        new Cesium.ClippingPlane(
          new Cesium.Cartesian3(0.0, -1.0, 0.0),
          -15.0
        ),
      ],
    });
    var clippingPlanecollection2 = new Cesium.ClippingPlaneCollection({
      planes: [
        new Cesium.ClippingPlane(new Cesium.Cartesian3(1.0, 0.0, 0.0), 1000),
        new Cesium.ClippingPlane(
          new Cesium.Cartesian3(-1.0, 0.0, 0.0),
          -2000.0
        ),
        new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 1.0, 0.0), -15.0),
        new Cesium.ClippingPlane(
          new Cesium.Cartesian3(0.0, -1.0, 0.0),
          -15.0
        ),
      ],
    });

    globe.multiClippingPlanes = new Cesium.MultiClippingPlaneCollection({
      collections: [clippingPlanecollection1, clippingPlanecollection2],
      modelMatrix: entity.computeModelMatrix(Cesium.JulianDate.now()),
      edgeWidth: 1,
      edgeColor: Cesium.Color.WHITE,
    });

The key point is to rewrite the orginal getClippingFunction.js to getMultiClippingFunction.js to make the fragment shader able to handle multiple clipping plane collections. The shader also needs to know the length of every collection so it can get the correct clipping plane.

This is only a temporary solution on multi-clipping on terrain, more problems to be solved:

  1. Different styles and model matrix on each ClippingPlaneCollection
    are not supportive. They’re set on the ClippingPlaneCollection and
    are the same for each collection.

  2. It dosen’t support concave polygon
    directly. But you could try decomposing the polygon into convex
    polygons. The star below is actually two triangles.

  3. It only works on the globe terrain with every ClippingPlaneCollection’s
    unionClippingRegions set to false.

  4. I didn’t rewrite the union function. Clipping on 3dtiles and models is out of scope, but I
    think the concept is similar.

  5. There might be bugs. : P

Hope this feautre will come out soon!

学习cesium地形开挖功能(地形裁剪,凸多边形裁剪,凹多边形裁剪) cesium地形开挖功能(地形裁剪,凸多边形裁剪,凹多边形裁剪),主要是运用到官方API:Cesium.ClipPlaneCollection,Cesium.ClippingPlane,Cesium.ClipPlane,Cesium.Plane,Cesium.ClippingPolygon,Cesium.ClippingPolygonCollection。 阅读详情

相关推荐

cesium 3dtile ClippingPlanes 多边形挖洞ClippingPlaneCollection

在Cesium3D Tiles(如城市模型)Primitives(如几何体)Models(如 glTF 模型)Terrain(地形)Imagery(影像图层)Skybox(天空盒)(自定义几何体)这些对象可以通过结合多个切割面来实现不同的裁剪效果,从而动态地控制场景中的可见部分。

this__valve的博客 1510

cesium-地面裁剪(多个剪切面)

cesium-地面裁剪(多个剪切面) 介绍 我之前的文章介绍过地面裁剪的实现,这里介绍一下裁剪多个面的方式。 Cesium自带的ClippingPlaneCollection只能实现单凸多边形挖除,为了实现多个面的裁切和简单凹多边形,这里我们需要修源码以提供支持。 在github中的问题讨论中已经有人实现了,实现方式需要重新打包源码 具体的详解 实现效果 源码打包 这里我使用的cesium源码版本为:1.79.1下载地址 打包工具使用的是webstorm node.js版本为14.17.5 替换

孙霸天的专栏 5532

重读Cesium(二):修改源码增加多区域挖空功能

该方法仅支持挖出凸多边形。想要挖凹多边形,需要把凹多边形分拆成多个凸多边形分别进行开挖。

GIS肆月 697

cesium ClippingPolygon多边形裁切

多边形裁切

tianyapai的专栏 2873

ABB机器人C#二次开发实战:从通信打通到数据读写的落地指南(附完整工程)

最近在做自动化产线升级项目时,遇到一个核心需求:用C#上位机实时读取ABB机器人的关节角度、IO信号,同时下发运动指令和参数配置。翻遍全网,要么是Robot Studio的基础操作教程,要么是C++/VC++的老旧案例,C#相关的实操内容要么只给片段代码,要么跳过通信配置、权限设置等关键步骤,导致刚上手时踩了无数坑——连接超时、数据读不到、写入无响应,甚至误触发机器人安全保护。

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 1389

过压保护电路(OVP)

作者:AirCity 2020.2.4 Aircity007@sina.com 本文所有权归作者Aircity所有 1 示例一 当VBUS=5V时,各点电压电流如图所示,Q1接近截止,输出信号是5V。 当VBUS=5.4V开始,输出信号开始下降,直到VBUS=6.1V,输出信号降低为0.6V。 下面是实测波形,这个电路,输出信号的电压不会超过5.4V,这个输出信号可用于电源的控制信号。 2 ...

AirCity123的博客 3万+

【Cesium】模型平面裁切

【代码】【Cesium】模型平面裁切。

Wangzx的博客 1416

【软件逆向】带壳带反调试找flag教程(VMProtect3.0+X64dbg+ScyllaHide)

【软件逆向】带壳带反调试找flag教程(VMProtect 3.0+X64dbg+ScyllaHide)

zhangjiuding的博客 7506

Cesium,ClippingPlanes,任意剪裁面对3DTiles剪裁

一、简介 相关官方文档地址:ClippingPlaneCollection、Cesium3DTileset 官方Demo地址:3D Tiles Clipping Planes 官方介绍:Cesium Feature Highlight: Clipping Planes 对于3DTiles和gltf,均可以通过ClippingPlaneCollection来实现显示时的模型剪裁显示,即仅显示模型的一...

BianLingSFW 9939

【ros】ROS1的安装和相关使用方法

主要学习ros相关内容

Greary的博客 2376

华为2022硬件逻辑笔试题

单选题(每题两分) 1.以下关于过程赋值的描述,不正确的是() A在非阻塞性过程赋值中,使用赋值符号“< =” B赋值操作符是“=”的过程赋值是阻塞性过程赋值 C在非阻塞性过程赋值中,对目标的赋值是非阻塞的(因为时延),但可预定在将来某个时间步发生(根据时延:如果是0时延,那么在当前时间步结束) D非阻塞性过程赋值在其后所有语句执行前执行 解:D 2.芯片的功耗和下列哪种不强相关_____________。 A资源利用率 B核电压 C组合逻辑级数 D翻转率 解:A 3.下列说

weixin_44072819的博客 1万+

Cesium——平面裁切

关于平面裁切的例子,官网有两个,3D Tiles裁切和地形裁切。 1、ClippingPlaneCollection 要实现平面裁切,首先需要创建裁切平面,根据官网的例子我们创建一个裁切平面。我们在api文档中找到ClippingPlaneCollection,创建Cesium.ClippingPlaneCollection的options如下: new Cesium.ClippingPlaneC...

Yel_Liu的博客 1万+

OpenClaw人人养虾:接入Synology Chat

Synology Chat 是群晖 NAS(Network Attached Storage,网络附属存储)内置的即时通讯应用。

王国平的博客 777

Cesium地形裁剪(任意多边形,多区域裁剪)

要做到这个功能需要修改cesium的源码,修改了GlobeVS.js、GlobeFS.js、Globe.js、GlobeSurfaceTileProvider.js、GlobeSurfaceShaderSet.js文件。

qq_40043761的博客 4653

Python无法拒绝的表白界面(完整代码)

Python制作一个无法拒绝的表白界面的完整代码。

AIGC 5万+

手把手教你学Simulink--基于Simulink的风力发电系统用双馈电机控制仿真建模

特点高效节能:在广泛的风速范围内保持高效的能量转换。独立控制有功和无功功率:通过控制转子电流实现对有功和无功功率的独立调节。较低的成本:相比直接驱动或全功率变流器方案,成本较低。挑战控制复杂度较高:需要复杂的控制算法来实现有功和无功功率的解耦控制。对电网波动敏感:需要良好的稳定性控制策略以应对电网电压波动。利用Simscape Electrical中的模块构建DFIG的物理模型,配置参数如电阻、电感、极对数等。matlab深色版本% 添加DFIG电机模块。

MHD0815的博客 346

CESIUM例子学习(十一)——3DTiles Clipping Planes(1)

3DTiles Clipping Planes例子,可以很容易实现对BIM、Point Cloud、Instanced、Model的任意剖切,其中Instanced是到底是一个什么对象,是怎么来的还不清楚。3DTiles Clipping Planes,对于BIM说来应用场景是有的,比如,需要查看一个建筑内部,应用从上到下的剖分,可以查看内部的结构。但对于点云和model有什么用呢?反正到现在我还没想出来。但从学习的角度去看,还是可以的。 一、模型剖切 ...

luoyun620的博客 4344

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Ccesium 实现地形开挖,多区域

新版本多区域使用的 ClippingPolygonCollection

HTML6549的博客 501

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

cesium-地面裁剪

cesium-地面裁剪 介绍 在cesium中有些模型是在地下、建筑物中的,因此需要对地表、山体或建筑物进行裁剪,展示内部的模型 cesium中裁剪的方法是new Cesium.ClippingPlaneCollection() 思路 地下裁剪,选中地面某一点,绘制一个标准矩形,进行裁剪 完整代码 <!DOCTYPE html> <html lang="en"> <head> <!-- Use correct character set. -->

孙霸天的专栏 1967

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Cesium模型裁切原理

Cesium的官方示例中提供了3D模型裁切获取剖切面的示例,相信很多初次接触cesium的小伙伴第一次看时都会和我一样,虽然本地能跑起来,但是对整个流程缺乏整体的理解,也不清除原理和每一步是干啥,最近整理了一下这个流程并记录下来。

qq_37987033的博客 4180

cesium 模型裁剪分析(模型内部裁剪和外部裁剪)

一、模型裁剪分析 对3D Tileset模型进行裁剪分析,可任意绘制多边形范围进行裁剪,具体效果如下 未裁剪模型局部范围效果图 外部裁剪效果图 内部裁剪效果图 二、完整代码 <template> <div id="geologyClipPlanDiv" v-if="geologyClipPlanIsShow"> <table style="text-align: right;"> <tr> ..

wangyong_h 5046

Cesium Model 中的剪裁平面 (ClippingPlane)

参考: https://www.cnblogs.com/webgl-angela/p/9197672.html。

qq_21476953的博客 1450

基于cesium不限制方向随意绘制不规则形状切割倾斜模型或地形

因业务场景需求,编写一款基于cesium不限制方向随意绘制不规则形状切割倾斜模型或者地形的插件, 我的这个插件已经判断是否是顺时针,将顺时针转换成逆时针,我这里已经在重要代码加了注释...

1235

cesium-地形裁剪-绘制多边形裁剪

cesium-地形裁剪-绘制多边形裁剪 介绍 之前的文章介绍过,cesium绘制多边形和裁剪地形,这里我将两功能融合起来实现绘制多边形裁剪地形 这里只能裁剪凸多边形 效果 先上效果 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-PBYEtFsE-1644807360703)(https://gitee.com/SunBaTian/notes_images/raw/master/%20image/notes_mac/image-20220214104838101.png)]

孙霸天的专栏 3505

基于cesium的地形开挖地形剖切

基于cesium地形开挖结合示例以及官方代码修改后封装TerrainClipPlan.js文件,在代码引入即可使用,详细介绍请往下看 一、地形剖切效果图 : 图一 图二 二、核心代码 根据绘制范围构建剖切点数据 for (var r = 0; r < i; ++r) { var s = (r + 1) % i, u = Cesium.Cartographic.fromCartesian(e[r]), ...

wangyong_h 9702

CesiumJS高级特性:裁剪、样式与性能优化

CesiumJS高级特性:裁剪、样式与性能优化 【免费下载链接】cesium 项目地址: https://gitcode.com/gh_mirrors/ces/cesium ...

gitblog_01188的博客 788
上一篇: el-dialog 弹出层实现拖拽、拉伸、双击全屏效果
下一篇: js动态引入第三方库
leemraz
博客等级 码龄14年 138粉丝 140原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值