Coincident Point Brake the Window

A forum dedicated to the Draft, Arch and BIM workbenches development.
User avatar
rockn
Posts: 1513
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Coincident Point Brake the Window

Postby rockn » Tue Dec 23, 2014 3:20 pm

Hi,

I'm trying to create a wood ossature to window with Arch Window tool.
See attached file :
BM_45x145_WCadre.fcstd
(19.32 KiB) Downloaded 36 times
But when I have coincident point, I get this error :

Code: Select all

Traceback (most recent call last):
  File "/home/jo/Logiciels/FreeCAD/free-cad-code/woodgalaxy_freecad/master_build/Mod/Arch/ArchWindow.py", line 662, in execute
    wires.append(obj.Base.Shape.Wires[j])
<type 'exceptions.IndexError'>: list index out of range
this appen whatever the way I constrained point (coincident point or both horizontal and vertical relative lenght are equal to zero).

Is there another way, and why window tool don't allow me to do this ?
Formations et tutoriels FreeCAD en Français, soutenez moi : https://www.tipeee.com/formations-freecad
ulrich1a
Posts: 1872
Joined: Sun Jul 07, 2013 12:08 pm

Re: Coincident Point Brake the Window

Postby ulrich1a » Tue Dec 23, 2014 7:27 pm

I was recently using the following function from Mod/Draft/DraftVecUtils.py in a script without using the Draft-workbench:

Code: Select all

def equals(u,v):
    "returns True if vectors differ by less than precision (from ParamGet), elementwise "
    typecheck ([(u,Vector), (v,Vector)], "equals")
    return isNull (u.sub(v))
It gave me unexpected results. I had the impression the precision value was not observed. Or some vectors had an unexpected high tolerance value. The debugging of my script was not easy, as the unexpected results made often several lines later in the code problems.
This may not be related to your problem, but did came in mind to me, as I had similar error messages.

Ulrich

OS: Debian GNU/Linux 8.0 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4316 (Git)
Branch: remotes/origin/master
Hash: 2b01506c65113840318697f58cf384944bd1192a
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.1
User avatar
yorik
Site Admin
Posts: 11044
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Coincident Point Brake the Window

Postby yorik » Wed Dec 24, 2014 2:45 pm

Wow, nice! That's a pretty advanced window!

Indeed you will always meet problems with coincident points in sketches. That is because inside the sketch, the geometry is not stored as continuous wires, but as separate segments. Then, when building the shape, the sketcher automatically joins these segments into wires, based on coincidence constraints. And sometimes, for example in "Y" situations, its decision of which segments are part of a same wire is not what you want.

Basically the only way to makes things clean is to never have more than 2 edges connected on a same point in the sketch. I met the same problem with the window presets, and I solved it by leaving a small "tolerance" gap (like one millimeter) where needed...