Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / CSG Difference Problem!

Author
Message
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 18th Sep 2014 18:43
Hello guyz,

Sometimes the CSG DIFFERENCE has a bug or at least i consider it a bug. Do you know how can i solve this problem? In the left side we have the csg difference but made an interily new cube as for the right side, it made a perfect hole.

Thank You!

Rims Flames
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Sep 2014 20:39
I've no idea what you've done or tried to do.



Powered by Free Banners
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 18th Sep 2014 22:00
I was making holes in the wall, and after making several of them, that cube appeared instead of a hole.

Rims Flames
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Sep 2014 22:07
Do you have a simple snippet demonstrating the problem?

Actually, I sympathise. I've always found the CSG commands somewhat unpredictable in the way they work - possibly because the Help file doesn't clearly explain what they do.



Powered by Free Banners
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 19th Sep 2014 00:09
I have the photo attached, the code is just perform csg difference

Rims Flames
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Sep 2014 01:42
Quote: "the code is just perform csg difference"


No it isn't. You talk about cubes, etc. Let's see simple runnable sample code which shows the problem.



Powered by Free Banners
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 19th Sep 2014 10:39
I can't show you an example because the problem appears sometimes when trying to CARVE in an object, i said that instead a of a HOLE in the object it makes (where the HOLE must be), A CUBE. It can't be showed on an example cuz the bug appears sometimes and i attached on my first post a photo that represents the problem.

Rims Flames
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Sep 2014 11:36
Hi there. I have noticed this problem before , but it occurs only when we carve an object that has a wall with zero size . This hapens every time we try to carve a plain object, so if we have a box 20,20,0 then we will get a cube instead of a hole. Why this hapens only from time to time ? . This could be when we carve objects freehand because we do not control how we move .

This never happens if we automate the process . We can execute this code thousands of times and it will neve fail.


I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Sep 2014 12:50 Edited at: 19th Sep 2014 12:51
Quote: "This never happens if we automate the process . We can execute this code thousands of times and it will neve fail."


But this simple variation of your code fails after several holes - see image. Perhaps something like this is the problem Rims Flames is having?





The CSG commands seem to be very expensive once the complexity of the object increases - notice how my demo lags noticeably after a few holes have been created.

Nevertheless, your demo is a nice demo of how to use the commands successfully.



Powered by Free Banners
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 19th Sep 2014 15:31
Yes kind of like what is happen in GG's photo. Chafari, my application is an editor and i can't set that function to automatically is not a way to make it manually and not to fail?

Thank you very much!

Rims Flames
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Sep 2014 15:51
@GG
What Rims Flames means, is that some times there is not a hole but a box . In the example you show us, this is a hole but it doesn't go through the object completely . Of course that this boolean commands are too expensive , but that is ok for making 40 windows or more to your object

I'm not a grumpy grandpa
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Sep 2014 15:56
Quote: " Chafari, my application is an editor and i can't set that function to automatically is not a way to make it manually and not to fail?"


Yes there are a way to get this. If you save your model from time to time and load it again. I've been using boolean long ago without any problem.

http://forum.thegamecreators.com/?m=forum_view&t=191335&b=1

Cheers.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Sep 2014 18:35 Edited at: 19th Sep 2014 18:48
Quote: "Of course that this boolean commands are too expensive , but that is ok for making 40 windows or more to your object"


Agreed.

Quote: "Yes there are a way to get this. If you save your model from time to time and load it again."


Interesting. I wonder if that trick works with my demo? I'll test and report back.

Edit No it doesn't.



Powered by Free Banners
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Sep 2014 19:43
Quote: "I wonder if that trick works with my demo? I'll test and report back."


Which one ?

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Sep 2014 19:54 Edited at: 19th Sep 2014 19:58
I've only posted one on this thread.

But just in case you can't find it, it's here:

http://forum.thegamecreators.com/?m=forum_view&t=212156&b=1&msg=2534252#m2534252



Powered by Free Banners
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 19th Sep 2014 20:26
Ok so i must save delete and reload the object from time to time to avoid those problems.

Rims Flames
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Sep 2014 20:31 Edited at: 19th Sep 2014 20:32
Quote: "Ok so i must save delete and reload the object from time to time to avoid those problems."


You could save when you see that the result is OK and then load again.

Quote: "I've only posted one on this thread.
"

Oops! This rivete machine was an old example I made time ago. I you look carefully to the code, you will see that there are so many booleand operation as while fr is being 5. We need here a counter to avoid this to happen . Something like this :



@GG Have you tested Save/Load ?

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Sep 2014 20:33
Quote: "Ok so i must save delete and reload the object from time to time to avoid those problems."


Not according to my demo. When I add that step to my modified version of Chafari's code the problems remain. Here's the bit I changed:



Perhaps Chafari had something different in mind?



Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Sep 2014 20:36
Quote: "@GG Have you tested Save/Load ?"


Yes. See my previous three posts.



Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Sep 2014 20:46
Just tested saving the object as a mesh instead of dbo. Still the same two problems. Here's the mesh code I used:





Powered by Free Banners
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Sep 2014 20:47
When I said saving from time to time, I meant that we had to save the object when we see that our model is ok , just in case if something wrong happens. I remember in old Blender programs, that it didn't have any pop up menu when we want to quit asking if we decide to save...after lot of time working, if we quit but not save for error, it was imposible to get the file back. So if we save the model and in the next step goes wrong so we can load last step.

I'm not a grumpy grandpa
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Sep 2014 20:51
I think we both thought you meant that your save/load would solve the problem.

I wonder what goes wrong? Seems like a bug as Rims Flames suggests.

Anyway, we now have some simple demos of things that do work - we just have to avoid trying to do anything too complicated.



Powered by Free Banners
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 19th Sep 2014 21:06 Edited at: 20th Sep 2014 06:31
Quote: "we just have to avoid trying to do anything too complicated."


I'm agree

Edit

UP TO 625 BOOLEANS !




I'm not a grumpy grandpa
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 20th Sep 2014 18:32
A better way to use booleans. In the same way we make lots of boxes with FOR/NEXT instead of using:
Quote: "make object 1,10,10,10
make object 2,10,10,10
make object 3,10,10,10
etc...
"


We can just make a boolean and use its mesh to make a new boolean.



I'm not a grumpy grandpa
Rims Flames
12
Years of Service
User Offline
Joined: 5th Apr 2014
Location:
Posted: 23rd Sep 2014 13:22
Well Chafari,

I tried to reload the object after saving it but still it looks the same, with the cubes instead of holes in the object...

Rims Flames

Login to post a reply

Server time is: 2026-07-18 09:24:50
Your offset time is: 2026-07-18 09:24:50