切割物体
-
预备知识
##介绍你可以通过用一个物体来切割另一个物体来创建很多有趣的形状。举个例子,下列这个物体就是利用一个柱体来切割一个盒子得到的:
https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/8698213/h1.gif" width="350" style="border-radius: 5px; border: 1px solid #29622d;">
需要注意的是,切割是一个非常花费时间的操作。两个物体之间的细节越多,需要用来进行切割操作的时间就越长。举个例子,一个球体比起一个盒子拥有更多的细节(定点,棱角和面),所以切割球体需要花费的时间会更长。
”切割物体“编程积木
要制作一个切割品,你首先需要两个有名称的物体。它们也需要有重叠的部分,否则切割操作之后没有东西会被改变。接着,你就只需要运行这个编程积木:
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/a68e36ec-3b59-43d3-b634-575b3f9c06ab.png" width="300" style="">
当你运行这个编程积木,第二个物体(将会被切割的目标物体)的重叠部分将会被移除,而第一个物体(作为切割器的物体)将不会被改变。
例子1:先切割后移除
在一个基本使用例子中,你在一个物体上切割了一个洞,而你需要移除作为切割器的物体,才能展示那个洞。就像展示的一样,当你运行了”切割“编程积木后,看起来好像没有什么事情发生。虽然如此,在移除了青色盒子之后,我们会看见黄色盒子上的孔。
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/f8ab417f-d65f-4d0b-ad51-a5d35a9da5b5.gif" width="900" style="border-radius: 5px; border: 1px solid #29622d;">
例子2:重新使用作为切割器的物体
有的时候,我们不需要在进行切割之后直接移除作为切割器的物体。相反,我们可以重新使用它来进行更多的切割。这样的操作会确保我们得到的孔或洞会有一样的尺寸。在这个例子中,进行第一个切割后,我们旋转作为切割器的物体”C“来进行另一个切割。
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/570be9ba-9ad0-4f1f-a697-c71805a62334.png" width="600" style="">
https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9018298/c4.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">
运行一下试试看:
https://play.creaticode.cn/projects/7def30b673781fc7d1e69b9e
-
I CreatiCode pinned this topic on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login