selfscripted face with hole

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
lagunax
Posts: 55
Joined: Wed May 25, 2022 5:12 pm

Re: selfscripted face with hole

Post by lagunax »

hm, i tried to make hole and outer edge with one polyline. will try more now. thanks
lagunax
Posts: 55
Joined: Wed May 25, 2022 5:12 pm

Re: selfscripted face with hole

Post by lagunax »

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?
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: selfscripted face with hole

Post by onekk »

lagunax wrote: Mon Jan 30, 2023 4:51 pm 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?
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:
se_adv1.png
se_adv1.png (85.9 KiB) Viewed 789 times
se_adv2.png
se_adv2.png (54.45 KiB) Viewed 789 times
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/
edwilliams16
Veteran
Posts: 3106
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: selfscripted face with hole

Post by edwilliams16 »

@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.
lagunax
Posts: 55
Joined: Wed May 25, 2022 5:12 pm

Re: selfscripted face with hole

Post by lagunax »

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.
lagunax
Posts: 55
Joined: Wed May 25, 2022 5:12 pm

Re: selfscripted face with hole

Post by lagunax »

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.
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).
As i understand at this moment i will mast use ViewProvider to recalculate and rebuild object ("control face") on-the-fly.
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: selfscripted face with hole

Post by onekk »

lagunax wrote: Tue Jan 31, 2023 4:59 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.

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/
lagunax
Posts: 55
Joined: Wed May 25, 2022 5:12 pm

Re: selfscripted face with hole

Post by lagunax »

onekk 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.
anyway thanks for helping
Post Reply