-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to handle Surfaces part of a component but not an instance? #18
Comments
Perhaps an other way to put it, do you know of a way to get all the faces with the correct transform? Because at the moment some faces don't get transforms applied. Here is my class: ' class SketchUpReader
|
Hi @Kevinator123 so you want to get all surfaces as one list, correct?
|
Thanks for answering, the way I do it right now is check each instance, surface and group on model level and keep on going down the nested components but I'm still missing faces somehow. https://github.com/Kevinator123/SketchUpReader/blob/master/ReadSKPConsole/Program.cs |
Did you check for nested instances etc? |
I think I checked all nested surfaces, foreach instance I get the parent component, for each of those components I draw the surfaces, I check the groups and check the instances. For each group I check the instances and their parent components and nested groups and for components I draw the surfaces, check for new instances and new groups. I also check for surfaces, groups and components on model level. |
Are you able to check your SKP file to see which geometries haven't been imported? |
It definitely are just faces so I think it can be meshed, they are part of an instance. But what I just noticed is that everything that doesn't draw has as type: Type undefined. Perhaps that has something to do with it? Then again some things that have type undefined do draw.... |
Type undefined sounds odd, can you share your skp model with me so I can have a look. And please point me to the failing faces. |
So here is a skp file that has a lot of missing faces: https://drive.google.com/open?id=1Qrv8ca_dGlpYQqXdsAImo9u-jls35JND So that's how it's supposed to look and this is how it looks: |
@ KevinHuyskens Hello, do you import SKP with unity?I am doing the same thing, can you give me some reference? |
@KevinHuyskens , sorry just realizing you answered quite some time ago. I was wondering when I looked at your code: what about instances that contain other instances? and what about components containing components? both cases are not coughed. |
@13704017891 Yes, I load the file externally and pass all the faces through with a named pipe. (haven't worked on this project for quiete some time). (Same person, different account) |
@moethu took a look at your suggestion just now, but your library's Instance object doesn't contain any Instances and Component doesn't contain any Components so I can't catch those cases :') |
Did you check the Dynamo implementation as a reference? The components in there were able to catch all geometries so far. https://github.com/moethu/SketchUpNET/blob/master/SketchUp/SketchUpNET/SketchUpForDynamo/SketchUp.cs |
So instead of going over my old code I started completely over, here is a code sample for writing out everything in a treeview in wpf (I excluded edges and curves because I don't need them). Here is the sample: https://pastebin.com/XpRWYruK Redoing it I can already see I missed some essential parts in my previous approach so I'll let you know how it goes from here on, but I've a feeling that I'm on the right track ;) |
Let me know if anything is missing in the library |
Each vertice that is part of a surface which is part of an instance you can use .GetTransformed on and you get the correct position of the vertice to build your mesh but some components aren't part of an instance and contain surfaces that aren't part of an instance so how do you go about positioning those vertices in the correct place?
Sorry I have to ask it here but I don't know where else to go, the documentation on SketchUp file structures is very limited.
The text was updated successfully, but these errors were encountered: