selfscripted face with hole
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: selfscripted face with hole
hm, i tried to make hole and outer edge with one polyline. will try more now. thanks
Re: selfscripted face with hole
can you follow me the way where i can in updateData inside ViewProviderControlFace get points of inner faces(holes)?
self.data.point.setNum(pts_num) - in this case pts_num= sum of lens of all arrays (outer and inner(holes)), am i right?
self.data.point.setNum(pts_num) - in this case pts_num= sum of lens of all arrays (outer and inner(holes)), am i right?
Re: selfscripted face with hole
Sorry, I can't guess what you are talking about, if you are trying to create something different from shapes, (as the ViewProvider seems to suggest), I can't help too much, I have only scratched this matter (even if I have worked on these things sometimes), but it heavily depends on many informations you are not providing.
My code is totally different and is related to the creation of the face, (I'm quite skilled in this sort of things.)
One of my latest development images:
All scripted, even the assembly of the various components. it has to be printed.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
-
- Veteran
- Posts: 3192
- Joined: Thu Sep 24, 2020 10:31 pm
- Location: Hawaii
- Contact:
Re: selfscripted face with hole
@lagunax
I'm amazed your code gives any result at all! To create a face with holes you should provide a list of wires. The first wire is the outer wire, the remainder the holes. Each wire has to be a closed, non-intersecting set of Edges. None of the wires can intersect with any of the others.
You have provided a single self-intersecting polyline. The code has tried to make sense of this and has not succeeded. I don't see how it could.
I'm amazed your code gives any result at all! To create a face with holes you should provide a list of wires. The first wire is the outer wire, the remainder the holes. Each wire has to be a closed, non-intersecting set of Edges. None of the wires can intersect with any of the others.
You have provided a single self-intersecting polyline. The code has tried to make sense of this and has not succeeded. I don't see how it could.
Re: selfscripted face with hole
actually "one-wired" face with holes was first idea how can i make holes in face. And idea not bad realy, but viewer somehow strange calculates tolerance as i understand. By logic it mast calculate internal space and show it (polyline closed, no crossing edges, but colinear with same vertices are exist) - but it can't work with situation when lines are match in any of there parts. so will use several wires now.
Re: selfscripted face with hole
totally im creating tool for making some calculations and automatic building of some construction elements (for example wooden roof). at this moment i'm working on planes to control construction process, so i need viewprovider, because them will be not only parametrized, but will be able to control and build it with just moving "control-points" by mouse. forms of those faces will be automaticaly recalculates wile moving (they will be some kind of control-planes, that also will show result of moving, like intersection of several slabs with intersection with other building elements).onekk wrote: ↑Mon Jan 30, 2023 5:25 pm Sorry, I can't guess what you are talking about, if you are trying to create something different from shapes, (as the ViewProvider seems to suggest), I can't help too much, I have only scratched this matter (even if I have worked on these things sometimes), but it heavily depends on many informations you are not providing.
As i understand at this moment i will mast use ViewProvider to recalculate and rebuild object ("control face") on-the-fly.
Re: selfscripted face with hole
Ok it is something complicated very "professional" and "commercial oriented" so slightly out of reach of my actual ability.
I have coded some "FeaturePython Objects" as a "payed programmer" (it is copyrighted code), but it was for a totally different scope, with no autoupdate mechanics and no "drag an drop", so I can't help too much in this area.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: selfscripted face with hole
anyway thanks for helpingonekk wrote: ↑Tue Jan 31, 2023 6:06 pm
Ok it is something complicated very "professional" and "commercial oriented" so slightly out of reach of my actual ability.
I have coded some "FeaturePython Objects" as a "payed programmer" (it is copyrighted code), but it was for a totally different scope, with no autoupdate mechanics and no "drag an drop", so I can't help too much in this area.