When a point v is inserted in the interior of a segment, we take
more care in computing the sites that are connected with v in the
final SDG. In L2, v is just connected to two sites, but in Linf,
we might have more neighbors.
The change is in the find_faces_to_split function, which also has
two additional parameters flipf, flipg that control whether there
will be new neighbors. This new function is used by
insert_exact_point_on_segment and insert_point_on_segment, which
are also changed to use flipf and flipg.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
Use the transformation matrix m = obj:matrix() of an object
(point or segment) to print the relevant points correctly.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
Be more diligent in Oriented_side_C2, when the finite
vertex is on the Linf-perpendicular line lp which is
passing through the splitting point p.
This fixes a problem with the following input:
$ cat ~/Dropbox/cgal/sdg/split/prob3seg.cin
s -172 -263 124 -49
s -109 -2 64 -202
s -117 -39 97 -39
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This fixes a drawing bug in the demo with input 3segconstr.cin:
s -268 65 238 71
s 206 -89 -241 -11
s -94 171 -155 -196
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
If construction templates for bisectors (line, segment, ray)
exist in the traits, then use them, otherwise, use the L2 traits.
The check is implemented by a type Has_bisector_constructions_type
that might be included in the traits and using the
"Substitution failure is not an error" (SFINAE) principle.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This is to prepare a generalized algorithm that chooses
construction traits automatically. The choice is controlled
by type Has_bisector_constructions_type. A similar change has
been done with the non-filtered traits too. I also commented out
the old code.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This is to prepare a generalized algorithm that chooses
construction traits automatically. The choice is controlled
by type Has_bisector_constructions_type. A similar change has
to be done for the filtered traits too. I also commented out
the old code.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This fixes a bug in the drawing of the following input:
s -12 19 -23 4
s 93 1 -12 19
s 7 -56 -91 36
Probably, a solution with more general bisectors should be also
considered. A similar solution has to probably also be implemented
in the following case for bisector_SS:
the intersection of the two supporting lines of the two segments
is not in the (strict) interior of any of the two segments
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This change uses the short-circuit evaluation of if.
It first checks that the two segments have no common
endpoint and only then checks if they are parallel.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
benchmark-linf-hv.cpp is added to check the
runtime for the inputs having only axis parallel segments.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
The following file r4m1knosegless1.cin gave a failed assertion:
p -100 -74
s -89 6 34 -98
p -23 -87
p -48 -91
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
I moved a lot of the functionality for deciding the Linf incircle
test for four points to the side of bounded square predicate.
In the case of query point t being on one of the sides of the
bounded square, I use the predicate test1d. Maybe even this can
be optimized, or made even more robust with some more checks.
A bug that is fixed with the current commit is in the following
input:
$ cat ~/Dropbox/cgal/sdg/panos/sqch1a.cin
p -51 -180
p -180 -30
p -180 20
p -7 -180
I also fixed a small bug when expanding both sides of the bounded
square.
The next step is to completely remove the slow "side of oriented
square" test.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
For the case PPP for incircle_p, use the bounded side predicate
before the oriented side predicate.
A similar change should probably be done in vring, too.
The oriented side predicate makes a lot of tests that are irrelevant
for a finite PPP vertex.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
The benchmarks do not support crossing segmetns.
The input should be fed from stdin and should
be in the the format of "p x y" or "s x1 y1 x2 y2"
per line. Do not give the total number of points
and segments in the first line (this is in contrast
with Menelaos' benchmark expected input).
Example input:
p 20 34
s 10 34 78 1
s 23 18 91 22
Example run:
n=600000 ;
rbox $n D2 s B180 | tail -n $n | awk '{print "p " $1 " " $2 }' |
time benchmark-linf
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
Store the result of comparison of t with coordinates
of bottom left and top right point of square.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
sdg-creation-time.cpp
This example only creates Linf sdg with general Linf traits
sdg-creation-time-hv.cpp
This example creates Linf sdg with Linf traits for axis parallel segments
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This fixes a problem with generating Segment_voronoi_2.moc:
opt/local/include/boost/type_traits/detail/has_binary_operator.hp:50:
Parse error at "BOOST_JOIN"
The problem did not appear before installing boost 1.53 with macports.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
In the case when q and t have the same support, the following
assertion is too strong:
CGAL_assertion(
same_points(q.source_site(), t.source_site()) or
same_points(q.source_site(), t.target_site()) or
same_points(q.target_site(), t.source_site()) or
same_points(q.target_site(), t.target_site()) )
This fixes a bug in the input br89.cin:
s 10 120 60 20
s 60 40 70 60
s 30 110 100 40
s 8 56 180 160
Probably, a similar assertion has to be removed that has to do
with r and t.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
I have also added some assertion that false is
returned when t and the point among p and q share
a coordinate.
Bug fix for 1seg2ptproblem.cin input:
s 10 120 60 20
p 60 40
p 70 40
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This is a bug fix for the following input br82.cin.
s 80 20 240 90
s 170 70 150 80
s 30 10 260 150
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This is a bug fix for the following input br80.cin.
s 10 120 60 20
s 60 40 70 60
s 30 110 100 40
A similar fix is probably required for fecf pqrt case,
when p is segment and q is a point. The fix works when
vertices (p,q,r) and (q,p,inf) are not on different arcs
of the Linf parabola of p and q.
Explanation for arcs:
The Linf-perpendicular line to q that passes through p partitions
the Linf-parabola of p and q in two arcs.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
The script ipe2cin converts all segments and points
in the first page of the ipe file given as the command
line argument to the SDG Linf cin format for segments
and points. The result is printed to the standard output.
Use refirection to save to a .cin file.
The file ipe2cin.lua has to be put in the appropriate
place, e.g., ~/.ipe/scripts/ and here is an example use:
ipescript ipe2cin ipe1.ipe > ipe1.cin
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
Several changes:
Reintroduce assertion for infinite faces in find_faces_to_split.
Use orientation_2_object instead of orientation_L2_2_object
in is_linear_chain.
Make primal agnostic to type of bisector line, ray, and segment.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
Also, try to see if it is possible to use vertex conflict
instead of the orientation Linf test in insert_third.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
The changes fix several bugs.
One choice involves a specific choice of bisectors to
compute the vv of three segments, that gives priority
to axis-parallel segments and segments that have a common
endpoint.
Maybe these changes should be also translated to vring.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
Problem with the following input is fixed now:
~/Dropbox/cgal/demo/Segment_Delaunay_graph_Linf_2/September/br50noseg.cin
s -50 -20 0 +30
s 0 +30 +50 -20
p -20 0
p +20 0
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
New predicates in Basic_predicates_C2.h:
is_site_h_or_v
is_site_horizontal
is_site_vertical
These predicates are used in several files in classes that are derived
from Basic_predicates_C2.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This fixes the bug for the input br10.cin:
s -100 110 0 100
s 200 80 -110 -190
p 0 0
s 0 100 200 80
However, it seems we must also check if things
are in the same quadrants.
The bug for input br20.cin is still there:
s -100 130 0 100
s 200 80 -110 -190
p 0 0
s 0 100 200 80
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This fixes the bug for input:
~/Dropbox/cgal/demo/Segment_Delaunay_graph_Linf_2/September/br10noseg.cin
s -100 110 0 100
s 200 80 -110 -190
p 0 0
In particular, vertex conflict of (M,CM,DE) with F now returns -1,
where M=(0,100), C=(-100,110), D=(200,80), E=(-110,-190), F=(0,0).
Maybe the same fix has to be done for qref.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
There was a problem with the following input.
$ cat ~/Dropbox/cgal/demo/Segment_Delaunay_graph_Linf_2/September/br3.cin
s 50 50 100 100
p 50 0
s 0 0 50 50
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
For A=(0,0), B=(100,0), C=(200,200), D=(200,250),
we had erroneously fecf(BC,A,AB,BD,-1) returning
false. The correct answer is true and it is fixed now.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
When q is point, we have the following assertion (again):
bool is_q_tsrc = same_points(q, t.source_site());
bool is_q_ttrg = same_points(q, t.target_site());
CGAL_assertion(not (is_q_tsrc or is_q_ttrg));
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
This is useful for use of Bisector_Linf in constrcutions.
I have also added support for Sign and Boolean.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
It solves the bug for the following input:
$ cat ~/Dropbox/cgal/demo/Segment_Delaunay_graph_Linf_2/September/5segA2.cins 0 0 0 100
s 0 100 100 100
s 0 0 100 100
p 50 50
p 50 100
s 50 50 50 100
It has to be further tested when the line l comes from a segment t which
is a strict subset of a side of the Linf square related to vertex vv.
Signed-off-by: Panagiotis Cheilaris <philaris@cs.ntua.gr>
I have only kept in an include directory at the root
the change in arrangement point location.
This change also requires to use some special local
includes in CMakeLists.txt files. I will do it in a
subsequent commit.