Computing polygons from intersecting lines

I have a bounding rectangle that a user can add lines onto. The lines will always extend to intersect the rectangle, so a new shape is always created. Does anyone have any ideas how I would traverse the lines and intersection points to create the bounded polygons created as each new line is added? I need to be able to color each piece of the created polygon differently.
Currently I create lines and intersections which I associated with each other. I then tried traversing all intersections on line switching to the intersecting line at each intersection point. I compare the distance to the origin to determine the best point to chose on the intersecting line, but this is problematic. Is there an easier way to do this?

I figured it out. You essentially have to keep
Split the lines into segments
Iterate through the list of segments
Track of the origin point
Determine if a candidate point crosses any other line.
etc.

Similar Messages

  • Setting VMware vCenter Computing Resources from command line

    Does anyone know how to set VMware vCenter Computing Resources from the command line? vda pool-setprops doesn't seem to include an option for it. Thanks.

    This document was posted in Aug 23, 2012. It covers Mountain Lion but Lion server may be similar.
    http://support.apple.com/kb/HT5359
    OS X Server (Mountain Lion)-based servers that need to run high performance services can use the command line utility serverinfo to dedicate systems resources.
    serverinfo --perfmode
    Gets the current mode
    serverinfo --setperfmode 1
    Sets the high performance mode
    serverinfo --setperfmode 0
    Disables the high performance mode.
    Note: Transitioning to or from high performance mode requires a restart.

  • Determining Polygons From Points Or Lines

    Hi,
    Does anyone have any ideas on this:
    I have created a drawing tool which allows a user to draw a floorplan of his house. The boundaries of each floor/room exist as a Vector of lines. From these lines (or points) I have to iterate through and determine which of these together form a singular enclosed space and is thus a room.
    I think the first step might be to find ALL the possible polygons that can be created from any or all of the points, but I cant get that far yet.
    Have been trying to create an algorithm for this for about a week and my brain hurts.
    Any help at all would be massively welcome.
    Cheers.

    Hi
    After doing some thinking my be it's not so difficult,
    If all the lines are horizontal (y1=y2), or vertical (x1=x1).
    From all this points we have to create all Polygons that will make a square.
    To check all Polygons, if one is included in a second Polygon remove the second one, in the end will will be left with the rooms.
    I will try to run it over the weekend.
    Noah

  • How to restore or backup Apex application from Command line ? URGENT

    We have Oracle apex 4.1 installed in Oracle 11g R2 database (windows 64-bit) 2008 R2
    For some reason our database dictionary objects are corrupted.
    We wanted to backup our Apex applications in some workspaces ASAP.
    We are not able to access apex from http://localhost:7777/pls/apex/htmldb_login
    We have an underlying database schema export (expdp).
    1) Is there a way to export or backup the apex application without logging into the apex URL ? if yes how ?
    2) Does Oracle has any of its own native tool to backup and restore from command line ?
    Thanks in advance

    My (MS Windows) experience, if I may; perhaps you'll find something useful.
    You'll find the README.TXT file in /apex/utilities directory. Read it.
    In order to use APEXExport, you need JDK version 1.5 or higher. Check your version by typing (and viewing the result):
    C:\>java –version
    java version "1.6.0_06"
    Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
    Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)Its directory should be part of the PATH environment variable: on my computer, directory name isC:\Program Files\Java\jre1.6.0_06\binFurthermore, Oracle JDBC class libraries must be part of the CLASSPATH environment variable. Check whether it exists (in Control Panel - System - Advanced - Environment Variables). For my 10gXE, it is here:C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jarI couldn't make it work; didn't know that ".\" directory must be entered into CLASSPATH as well (found that information in Arie Geller's book). Therefore, my final CLASSPATH version is:.\;C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jarOK, setup is done. Now, go to your /apex/utilities directory and, from the command prompt, run (mind the upper case!)java oracle.apex.APEXExportwhich will show a short help.
    I chose to export the whole workspace. In order to do that, I need the workspace ID (got it from Apex's SQL Workshop; that might be a problem as you can't get there, can you? I can't tell how to find that information apart from SQL Workshop, but I'm pretty sure someone, who is much more experienced than me, will know it). OK, here's how you find it:select v('WORKSPACE_ID') from dual;Finally, here's the final step - export:C:\apex\utilities>java oracle.apex.APEXExport -db localhost:1521:xe -user scott -password tiger -workspaceid 1038408092496568The result are fxxx.sql files (where "xxx" represents application number).
    I hope you'll manage to export your applications; basically, nothing special here (except that ".\" directory in the CLASSPATH variable).
    Best of luck!

  • How to find the intersecting lines

    Hi All,
    Can anyone tell me how to do this,
    I am selecting lines passing thourgh point P1(x1,y1) and
    another query select lines passing through point P2(x2,y2)
    Now I want to find the intersecting lines from the above result.
    Thank you
    Anju

    Hi,
    If I understood what you mean, just do the following:
    use your 2 queries as inline views (i.e. put them in the from
    clause of your query), and join them asking for the intersect of
    the 2 returned objects
    rgds

  • Unable to build and run Javapetstore using  Sun SDK from Command Line

    Hi,
    Here is a problem I?ve come across building and running JavaPetstore from Command Line using Ant.
    It shows that Build is successful but there is an error message in very beginning:
    ?Unable to locate tools. jar. Expected to find it in C:\Program Files\Java\jre 1.5.0_11\lib\tools.jar?
    But there is no such a file in jre-1.5.0_11 or previous versions.
    The only place where the file with such name can be found is jdk\lib.
    All attempts to run end up with:
    ? BUILD FAILED.
    C:\<PETSTORE_HOME>\bp-project\command-line-ant-task.xml:77;unable to find javac compiler;com.sun.tools.javac.Main is not on the class path.
    Perhaps JAVA_HOME does not point to JDK."
    Directories C:\Sun\SDK\bin and C:\Sun\SDK\jdk are in the PATH.
    JAVA_HOME as a System variable is set up to C:\Sun\SDK\jdk.
    Building and running other applications like a BluePrints or Samples bring to same result.
    I will post more information if needed.
    Thank you in advance for help.

    If you are using Windows XP:
    1. Right click on my computer
    2. Select Properties from the popup dialog
    3. Click on the "Advanced" tab
    4. Click the button towards the bottom that says "Environment Variables"
    5. In the dialog that pops up, look in both the User variables and the System variables for a variable named CLASSPATH
    6. If its not there, you need to create it. If you want to make it available to all users of your computer, create it as a System variable. If you only want it to be available to the current user, add it as a User variable.
    7. If it is there, or if you just created it, it needs to contain the following values: the current directory (symbolically abbreviated as a period: "."), any class libraries you want to be available to the java compiler (javac) or the java interpreter (java). By default, jre/lib and jre/lib/ext are searched for classes, so you don't need to include anything located in one of these folders on the classpath.

  • *Please*, how do i run from cmd line??

    I've written a program using swing, on JBuilder6 Personal, and when i run it under JBuilder it runs perfectly. But, how do i run the program from command line? I've tried adding those PATHs and CLASSPATHs but still i can't run the program. I've tried copying the java.exe program to the directory where my classes are, and tried running it from there, but still i had problems. It always says something like "Exception in thread "main", and a lot of other msgs.
    Also, i can't find any swing.jar file in my disk. Shouldn't i have it? On some sites people tells you to put the swing directory on your autoexec, but i don't seem find this directory. (Well, having it or not, the program runs *perfectly* under JBuilder, like i said before).
    Please, this is driving me crazy, i'm tired of searching on the internet for help with this problem!
    Just some extra notes:
    - I got Windows 98 SE on my computer
    - Here's how i'm trying to run the program: java PainelPrincipal (where "PainelPrincipal" is a .class file and it's got a main method)
    I'd appreciate *any* help,
    Victor.

    Here are the error msgs i get:
    Exception in thread "main" java.lang.NoClassDefFoundError: PainelPrincipal (wrong name: chat/PainelPrincipal)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
    ... (more +- 6 lines like these...)
    These are the msgs i get when i execute:
    java PainelPrincipal
    and "java.exe" is on the same directory as PainelPrincipal.class and all my other classes.
    When i tri to run java.exe not from the same directory where my classes are i get this one line msg error:
    Exception in thread "main" java.lang.NoClassDefFoundError: PainelPrincipal
    Well, that's it, hope it'll help you to help me.
    Victor.

  • Windows 7 Defrag from command line does not work

    We are running Windows 7 in a virtualized environment. When running windows defrag using schedule or from command line, it does not work. The command that I am executing as administrator is
    C:\Windows\system32>defrag /c
    Microsoft Disk Defragmenter
    Copyright (c) 2007 Microsoft Corp.
    It displays the above message and exits back to the command prompt. However if I run the command defrag C: it does work. Defragmenting from the GUI works as well as long as both the disks (C: and System Reserved) are selected and when I click on
    Defragment disks, works fine.
    I am concerned about defrag running from the task scheduler with the command "defrag /c" (auto scheduled using Configure Schedule... from Disk Defragmenter) does not work and the system never gets defragmented automatically.
    This happens only with some of the windows 7 VM's that we have.
    There are no entries in Event Log that point to the defrag (using task scheduler). Any ideas what may be going on?

    Hi,
    Could you defrag as below method:
    1. Open Disk Defragmenter by clicking the Start button. In the search box, type
    Disk Defragmenter, and then, in the list of results, click
    Disk Defragmenter.
    2.Under Current status, select the disk you want to defragment.
    3.To determine if the disk needs to be defragmented or not, click Analyze disk. Administrator permission required If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
    Once Windows is finished analyzing the disk, you can check the percentage of fragmentation on the disk in the
    Last Run column. If the number is above 10%, you should defragment the disk.
    4.Click Defragment disk. Administrator permission required If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
    For more information, please read this article:
    Ways to improve your computer's performance
    http://windows.microsoft.com/en-in/windows/improve-performance-defragmenting-hard-disk#1TC=windows-7
    Meanwhile, read this article:
    Defrag from the Command-Line for More Complete
    Control
    http://technet.microsoft.com/en-us/magazine/ff458356.aspx
    Karen Hu
    TechNet Community Support

  • I have a blue hanging screen with restart and I went to trade line stores and they refuse to help me saying that I didn't buy my iPad from trade line store ?

    I have a blue hanging screen with restart and I went to trade line stores and they refuse to help me saying that I didn't buy my iPad from trade line store ?

    Your problem might be a easy fix.
    If the firmware "forgets" what partition it's supposed to boot from, it won't load OS X, so if OS X doesn't load then it can't tell the fans to slow down, the default is "turbo mode".
    So all you might have to do is hold the option/alt key down while booting the computer with a charged up battery on power, you will then see a row of icons and you pick OS X to boot from.
    Once in you head to System Preferences and set the Startup Disk, that will tell the firmware what to boot from again.
    Try it and see if it works.
    You can do more if your problem is not fixed.
    Step by Step to fix your Mac
    Faica wrote:
    I wanted to know if I am able to go to the apple store and will they help me even though I didn't buy it from them.
    Yes, if it was purchased new you have a 1 year warranty, despite who you bought it from (unless it's stolen goods)
    However you should purchase AppleCare while your in the store for another 2 more years of coverage also a backup drive for TimeMachine to protect your data.

  • Powser Shell Script to Purge Computer Records from SCCM

    Hello!
    I have built a collection in Configuration Manager to bring in a list of computers that have duplicate names. Here is the query that I am using.
    select R.ResourceID,R.ResourceType,R.Name,R.SMSUniqueIdentifier,R.ResourceDomainORWorkgroup,R.Client from SMS_R_System as r   full join
    SMS_R_System as s1 on s1.ResourceId = r.ResourceId   full join SMS_R_System as s2 on s2.Name = s1.Name   where s1.Name = s2.Name and s1.ResourceId != s2.ResourceId
    I am building a PowerShell Script to obtain the names of the computer resources stored in the above SCCM 2012 collection and place them in a variable. Next,
    I want to obtain the computer resources (e.g., ddr records) and store them in a 2ed variable using the first variable to pipe in the data. I am using a “ForEach” looping construct to accomplish this. Lastly, I want to purge the computers records from the Configuration
    Manager database that are stored in the second variable which came from the computers names of the specified SCCM collection. I am attempting to use this line of code within my loop to purge the computer records from SCCM:
    $compObject.psbase.syncroot | % { $_.psbase.delete()
    Here is a
    blog I found suggesting this line of code.
    What I have discovered is rather interesting. My script works as intended, but even though the correct records  ARE
    being purged. The above line of code is returning an error.
    You cannot call a method on a null-valued expression.
    At line:18 char:35 + $compObject.psbase.syncroot | % { $_.psbase.delete() }
    +                                   ~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    I have a few questions:
    Does anyone know why this is occurring?
    Is there a different approach or code I should be using instead to purge the collected data?
    Here is my full script:
    #// required parameters
    $SCCMServer
    = "MySiteServer"
    $sitename
    = "PS1"
    $collectionID
    = "PS1009c8"
    #// Obtain collection members from $collectionID
    $SMSClients
    = Get-WmiObject
    -Query "SELECT * FROM SMS_FullCollectionMembership WHERE CollectionID='$collectionID' order by name" 
    -ComputerName $SCCMServer
    -Namespace  "ROOT\SMS\site_$sitename"
    #//looping construct to loop through all the colection members
    ForEach ($SMSclient
    in $SMSclients) {
    #// Loads computer records one at a time into $compobject variable using a ForEachloop to be deleted
    $compObject
    = get-wmiobject
    -query "select * from SMS_R_SYSTEM WHERE Name='$($smsclient.name)'"
    -computername $SCCMServer
    -namespace "ROOT\SMS\site_$sitename"
    #// Delete’s computer objects one at a time in $compObject variable from CM12 database
    $compObject.psbase.syncroot
    | % {
    $_.psbase.delete() }
    --Tony

    Daniel
    Have you ever used Orchestrator to kick off your Powershell scripts? I am using System Center 2012 R2 Orchestrator, and trying to use the "Run .Net Script" action to launch my Powershell code, but the process is failing.  When I run the code
    from within PowerShell and RunBook Tester the code executes as it should. When I run it from the RunBook I receive this error:
    Exception calling "Delete" with "0" argument(s): "Generic failure "
    Just curious if you had any thoughts why my code was blowing up in an Orchestrator RunBook when it works fine within PowerShell? My full code is below.
    #// required parameters
    $SCCMServer = "MySiteServer"
    $sitename = "PS1"
    $collectionID = "PS1009c8"
    #// Obtain collection members from $collectionID
    $SMSClients = Get-WmiObject -Query "SELECT * FROM SMS_FullCollectionMembership WHERE CollectionID='$collectionID' order by name" -ComputerName $SCCMServer -Namespace "ROOT\SMS\site_$sitename"
    #//looping construct to loop through all the colection members
    ForEach ($SMSclient in $SMSclients) {
    #// Obtains and deletes the SCCM computer records one at a time using a ForEachloop
    Get-WmiObject -query "select * from SMS_R_SYSTEM WHERE Name='$($smsclient.name)'" -computername $SCCMServer -namespace "ROOT\SMS\site_$sitename" |
    ForEach-Object { $_.Delete() }

  • How to send report output to  two  detinations at a time from command line?

    Hi ,
    how to send my report to two detinations at a time from command line i.e FILE and Mail ?
    i created batchfile in that i mentioned one line for file(DESTYPE=FILE) perpose and another line for mail perpose(DESTYPE=Mail).i don't want to mention to lines.
    i want to send my report out put two destinations at a time insted of running two times.
    thx in advance.....
    raghu

    hello,
    did you try to use distribution for that ? check out the reports distribution facilities available in 6i.
    regards,
    the oracle reports team

  • Error while running a Discoverer Workbook with parameter from command line

    I am trying to run a discoverer report from command line and export the results in xls on to my local machine. I could do it fine for a simple workbook, but if I add a parameter(madatory) to the workbook and run it from command line specifying the parameter value I wanted to run the report for, I do not get any results. Here is the command line I am using.
    dis51usr.exe /connect user/password@database /apps_user /apps_responsibility "System Administrator" /eul EUL_US /open C:\Disco\Test.DIS /sheet Testsheet /parameter Period Jan-07 /export xls C:\Disco\X.xls /batch
    Parameter value is entered in correct format(Jan-07).
    When I removed /batch from this to see if I get any error, Discoverer Desktop opened up, logged in and gets terminated saying 'Oracle Discoverer Desktop has encountered a problem and need to close. We are sorry for the inconvenience.'
    Did anybody come across this issue before?

    Hello,
    If you have a few minutes, Windows is also aborting for me:
    the differences are, my situation is:
    a) am running the command line from a .bat file
    b) am NOT running with parms, want the discoverer query to come up for the user
    c) am running a query from the database
    i am signing in as myself BUT running a query that was created by a generic user called SREG
    c) if i run the .bat file from Windows Explorer, the query opens fine
    d) if i execute the .bat file from within Microsoft Access using the shell command,
    the query opens and then aborts RIGHT BEFORE the parm screen would display
    e) btw, if i modify the .bat file, to run a query from MY database signon, then (d) - running .bat file
    from vb using SHELL command works
    Do you have a ideas as to why (d) does not work? I would be very grateful for your time, tx, sandra
    this is what i posted yesterday, tx: Re: Running Discoverer command line
    tx, sandra

  • VPN Client disconnection from command line

    Hi,
    I want to connect to IPsec VPN on ISA500 by VPN Client (v 5.0.07.0440, the last version, I think), using command line parameters.
    I can connect with the command:
    "%programfiles%\Cisco Systems\VPN Client\ipsecdialer.exe" -c -user myUser -pwd myPassword "MyConnectionEntry"
    but i don't know the command to disconnect from command lines.
    If I do
    "%programfiles%\Cisco Systems\VPN Client\ipsecdialer.exe" -?
    I obtain the list of parameters
    vpngui [-c | -sc [sd] [-user <username>] [-pwd <password> ! -eraseuserpwd]] <connection entry>
    but I don't unterstand what I have to do... I try every combination using -sd parameter (I think means for silent disconnect), but in every case I can only to show VPN interface  without disconnect anything...
    Can anyone help me?
    Thanks

    Prasath,
    This appears to be a data flow issue.  You need to look in the dataflow log file.  Your information indicates the project name is SAMPLES.xml, and the data flow ID is D20091213_014350765.  Look at the data flow log file in
    C:\dqxi\11_7\repository\configuration_rules\runtme_metadata\project_SAMPLES\D20091213_014350765
    Alternatively, you can temporarily replace the transactional reader and writter transforms with their corresonding batch transforms, and run the job from the Project Architect.  Any errors will be displayed in the Running window.
    Paul

  • Copy Trading Partner to Asset line items from Vendor line items in F-90

    Dear Friends,
    I want to copy trading partner field from Vendor line item to other line items like Asset and Tax in T.code - F-90
    Client want to use Transaction type - 100
    Is it feasible?
    Thanks in advance

    try:
    1) substitution - tcode OBBH
    or
    2) open FI - menu FIBF tcode BF44
        - event 1120 or 1130
    A.

  • How to clean project from comman line ?

    How to clean project from comman line ?
    I would like to invoke the same functionality as in Flex
    Builder Project -> clean... -> clean all projects...
    but from command line is it possible ?

    You can:
    1) Perform a project clean up (p.153 of the user manual) - it removes any unused recordings, samples and other files
    2) Consolidate project (p. 154 of manual) - this copies all the used audio material into the project folder and also deletes any empty folders within project folder, making it easier to navigate
    3) Save project as a copy - this creates another project folder, but without all the backups and other additional files

Maybe you are looking for