Code Monkey home page Code Monkey logo

drawsvg's People

Contributors

cmu462 avatar flafla2 avatar gandalfzyq avatar jburns20 avatar miyehn avatar nmwsharp avatar umangwadhwa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

drawsvg's Issues

Bug when switching between HW render and SW render ref mode

When I just finished Task 1, I might want to switch between Hardware render and Software renderer (ref mode) to check correctness. This switching is currently not smooth. When pressing H and R alternately, the program will switch in the sequence of HW, SW imp, HW, SW ref.

I have coded a patch and will open a pull request soon.

A question regarding the reference implementation of rasterizing the lines while zooming and dragging

Platform: Windows 11 + Visual Studio Environment with updated version of DrawSVG.
Description:
I implement the view transformation and test it with casual zooming and dragging, given the reference implementation.
However, in the case of test2.svg, when zooming into the central empty circle, certain lines are missing in the reference implementation, different from my implementation of rasterizing the lines.
Here are screenshots of my implementation (I haven't implemented the Xiaolin Wu's line algorithm):
Screenshot 2023-06-30 at 13 53 25
Screenshot 2023-06-30 at 13 55 59

Here are screenshots of the reference implementation (Notice that in the first image, certain lines in the left-bottom corner are missing):
Screenshot 2023-06-30 at 13 54 06
Screenshot 2023-06-30 at 13 56 16

I would like to know which one is correct? Or, are the missing lines intended?
I know that such a repository is left as it is and hasn't been updated, any feedback or discussion is welcomed. :)

New issue: alloc-dealloc-mismatch

Hi, i found something unusual in this repo, is it some kind of new bug ?

sample file

id3_alloc-dealloc-mismatch.zip

reproduce

command to reproduce : ./drawsvg [sample file]
The command will open a new window to display the svg file, close it and the crash info are as fellowed.

crash info

==41561==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x7ff1d825f800
    #0 0x536d40 in operator delete(void*) /home/bupt/Desktop/tools/llvm-12.0.1/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cpp:160
    #1 0x5bc830 in CMU462::OSDText::~OSDText() /home/bupt/Desktop/DrawSVG/CMU462/src/osdtext.cpp:35:3
    #2 0x591428 in CMU462::Viewer::~Viewer() /home/bupt/Desktop/DrawSVG/CMU462/src/viewer.cpp:56:3
    #3 0x582515 in main /home/bupt/Desktop/DrawSVG/src/main.cpp:116:1
    #4 0x7ff1e6f12c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310
    #5 0x45e1b9 in _start (/home/bupt/Desktop/DrawSVG/bu/drawsvg+0x45e1b9)

0x7ff1d825f800 is located 0 bytes inside of 264372-byte region [0x7ff1d825f800,0x7ff1d82a00b4)
allocated by thread T0 here:
    #0 0x5364a8 in operator new[](unsigned long) /home/bupt/Desktop/tools/llvm-12.0.1/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cpp:102
    #1 0x5bdb1e in CMU462::OSDText::init(bool) /home/bupt/Desktop/DrawSVG/CMU462/src/osdtext.cpp:58:10
    #2 0x591c2b in CMU462::Viewer::init() /home/bupt/Desktop/DrawSVG/CMU462/src/viewer.cpp:124:17
    #3 0x5824cb in main /home/bupt/Desktop/DrawSVG/src/main.cpp:110:10
    #4 0x7ff1e6f12c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310

SUMMARY: AddressSanitizer: alloc-dealloc-mismatch /home/bupt/Desktop/tools/llvm-12.0.1/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cpp:160 in operator delete(void*)
==41561==HINT: if you don't care about these errors you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0
==41561==ABORTING

For anyone using windows Clion not familiar C++ get stuck on the first step..

Windows build instructions using CLion
(tested on CLion 2018.3)
Open CLion, then do File -> Import Project..
In the popped out window, find and select the project folder ...\DrawSVG, click OK, click Open Existing Project, then select New Window
Make sure the drop down menu on top right has drawsvg selected (it should say drawsvg | Debug). Then open the drop down menu again and go to Edit Configurations..
Fill in Program arguments, say, ./svg/basic, then click Apply and close the popup
Now you should be able to click on the green run button on top right to run the project.

  1. Acutally the program arguments should by ../svg/basic, because in the view of drawSVG.exe, the root is parent folder.
  2. Mingw doesn't work because cmake wouldn't include FreeType as subdirectory for some reason ( compatibility maybe? IDK). So choose visual studio as toolchain in the Cmake setting.
  3. Have fun!

version:
Clion 2021.2
VS2022 preview

CMake can't find GLEW on Mac M2

All libraries are build. Managed to build Scotty3D
But DrawSVG fails to cmake ...

Getting an error:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
GLEW_LIBRARY
linked by target "CMU462" in directory /Users/rgorshkov/Documents/GitHub/DrawSVG/CMU462/src

GLEW was installed using brew

Unable to build with gcc 7.2

Not sure if this is open for outside feedback but just in case: I was unable to build this with the latest gcc 7.2 (ArchLinux) due to linker errors:

/usr/bin/ld: ../../src/reference/libdrawsvgref.a(viewport.cpp.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: ../../src/reference/libdrawsvgref.a(texture.cpp.o): relocation R_X86_64_32 against symbol _ZSt4cerr@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: ../../src/reference/libdrawsvgref.a(software_renderer.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output

I guess the reference code for the libdrawsvgref would need to be recompiled with an -fPIC flag.

FWIW, I was able to build fine with gcc 5.4 (ubuntu 16.04)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.