Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Constructing a parallel line segment

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Constructing a parallel line segment


Chronological Thread 
  • From: Efi Fogel <>
  • To:
  • Subject: Re: [cgal-discuss] Constructing a parallel line segment
  • Date: Thu, 21 Nov 2019 09:04:36 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:TRTw3hSJfqTnvAo4nObJB71XXdpsv+yvbD5Q0YIujvd0So/mwa6yYxGN2/xhgRfzUJnB7Loc0qyK6vumADFZqs/Z6jgrS99lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBoKevrB4Xck9q41/yo+53Ufg5EmCexbal9IRmrowjdrNQajIt/Jqo+1xfFvmVEcPlKyG11Il6egwzy7dqq8p559CRQtfMh98peXqj/Yq81U79WAik4Pm4s/MHkugXNQgWJ5nsHT2UZiQFIDBTf7BH7RZj+rC33vfdg1SaAPM32Sbc0WSm+76puVRTlhjsLOyI//WrKjcN+kb9boAm5pxNh34HUfI+bNP17fqzHfNMaQ3dKUsJeWiFFB4+xaZYEAegcMuZCt4TyqFUOohm+CweiB+3h1yFGiWPt0KIgz+gsCxvL0BA8E98MtnnfsdX7NL0VUeCw1KTGwjvDb/JL0jn974jIfQ4uofWRVr93b8XRx0gvFw3CjlWft4PlOyiY1usIs2eB7upgUfijhHIgqwF0uzWiwNonhIfOhoIQ0F/E9CN5zZ4zJdKiU0F0etqkH4VKuy6GMIt2R9suQ2BuuCYgy70Jo4S3fCYQyJg/xh7fbvOHc5WS4h75SOmRJjJ4iXR4c7y8nxa/6VasxvH4W8Wu01tHrjBJnsTNu30MzRDf98uKRuZ780y8wziAzRrT5ftBIU0slarUNZohwrkom5oWq0vDHyv2lFz3jK+Sa0ko4+ao5/nkb7n7vJOcOIh0igbxMqQqhMOzG/g3Mg8LX2SD+OS80qPs/VHhTblUkvE7lrPVvZPaKMgBu6K0Ag5Y3pw+5xu8EjuqyNEYkmMGLFJBdhKHlY/pO1TWLf/mA/e/glqskDBkx//YOr3sGZrNLn3Zn7fgebZx8VJTyA02zdxH/ZJbFqkBIO7vWk/2rNHXEhA5PBaww+r+Fdp915geVn6SAq+CK6PfqkSI5+IqI+mUfoAZojf9K/4/5/7vl3A1g1EdfbP6laYRc22yS/R6P12CMz2rmcYECW5MvwwkTeWshkfFSi9Wf3/1XqQy4XYwB4uiSIvCXYuwm6fS4CDuFZJfYiVKC0uHDGzzX4SCQfYFLiyIceF7lTlReLagA6Em2hyq/Fv3xbtpKeXZ/gUXsJvi0J5+4OiFxkJ6ziB9E8nIizLFdGpzhG5dG25vgfJP5Hdlw1LG6pBWxvxVEdsJuaFMWwY+cJ/Ylql0UoCrHA3GediNRRCtRdD0WWhgHOJ0+McHZgNGI/vnixnC2ySwBLpMzu6EAZU19uTX2H2jfp8hmUaD77EoihwdeuUKLXev3/ct+A3aBoqPmEKcxf6n

You should probably look at the approximated_offset_2() and offset_polygon_2() functions of the "2D Minkowski Sums" package.
The operations you are trying to apply, e.g., normalizing a vector, requires square-root.
If you don't want to compromise with the exact solution, you will have to use a number type that supports square-root (see offset_polygon_2()).
Otherwise, you can obtain an approximation (see approximated_offset_2()).
   ____  _        ____             _
  /_____/_) o    /__________  __  //
 (____ (   (    (    (_/ (_/-(-'_(/
                         _/




On Thu, 21 Nov 2019 at 05:10, billy <> wrote:
I'm using the 2D Arrangements package, and I want to construct the boundary
of a "hippodrome" around a line segment. Here's what it looks like around a
line segment 'e' https://imgur.com/UYNte2Q
To do this I'm trying to construct the two parallel line segments, and then
the two semicircles. The trouble is actually constructing those 4 points
where the parallel segments meet the semicircles.
If I could construct a vector perpendicular to the line segment with
magnitude r, I could construct a Transform from this vector and apply that
to the line segment and I'd be done. The Vector_2 class does support
constructing perpendicular vectors, but there seems to be no clear way to
make this vector have a chosen magnitude. The Direction_2 class says it
doesn't do normalisation, so it doesn't seem clear at all how to construct a
unit vector perpendicular to the line segment.



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss





Archive powered by MHonArc 2.6.18.

Top of Page