In this article, we are going to learn about how to disable uniform scaling in canvas using FabricJS. In FabricJS, an object gets transformed proportionally when dragged from the corners. However, we can disable this behavior by using the uniformScaling propertySyntaxnew fabric.Canvas(element: HTMLElement|String, { uniformScaling: Boolean }: Object)Parameterselement − This parameter is the element itself which can be derived using document.getElementById() or the id of the element itself. The FabricJS canvas will be initialized on this element.options (optional) − This parameter is an Object which provides additional customizations to our canvas. Using this parameter, properties such as color, ... Read More
In this article, we are going to create a canvas with a not-allowed cursor using FabricJS. A not-allowed cursor can be used to indicate that any action that has been requested, will not be carried out. not-allowed is one of the native cursor style available which can be used in the FabricJS canvas too.FabricJS provides various types of cursors like default, all-scroll, crosshair, col-resize, row-resize etc. which are reusing the native cursor underhood. Each of these cursors look slightly different based on operating system.Syntaxnew fabric.Canvas(element: HTMLElement|String, { defaultCursor: String }: Object)Parameterselement − This parameter is the element itself which ... Read More
In this article, we are going to how to add an object to the canvas by using the add method. After creating our canvas, we can populate it with various objects available in FabricJS like fabric. Circle, fabric.Ellipse or fabric.Line, etc.Syntaxcanvas.add(object: fabric.Object);Parametersobject − This parameter is of type fabric.Object and holds the objects that we want to add to our canvas.Example 1Creating the instance of an object inside canvas.add()Instead of creating the instance of an object first and then rendering it on the canvas by using the add() method, we can directly do so inside the add() method. Here is ... Read More
What is a Speed-Time Curve?Speed-time curves are the most convenient means of studying the movement of trains and their energy consumption. A speed-time curve is defined as the graph plotted between the speed and time, by taking speed (in km/hour) on the Y-axis and time (in seconds or minutes) on X-axis. The speed-time curve provides complete information of the motion of the train.The speed-time curve gives the speed of the train at various time instants after the start of the run directly. The slope of the curve at any point gives the acceleration at the corresponding instant or speed.The area ... Read More
Power Output from the Driving AxlesLet, 𝐹𝑡 = Tractive effort in Newton𝑉 = Speed of the train in kmphSince, the power output is defined as the work done per unit time, i.e., $$\mathrm{Power\: output, \mathit{P}\mathrm{\: =\: }Rate\: of \: work\: done\mathrm{\: =\: }\frac{Work \: done}{time}}$$$$\mathrm{\Rightarrow \mathit{P}\mathrm{\: =\: }\frac{Tractive\: effort\times Distance}{Time}\mathrm{\: =\: }Tractive\: effort\times Speed}$$$$\mathrm{\therefore \mathit{P\mathrm{\: =\: }F_{t}\times V}\: Nm/s}$$$$\mathrm{\Rightarrow \mathit{P\mathrm{\: =\: }F_{t}\times V}\times \frac{1000}{3600}\, Watts}$$$$\mathrm{\therefore \mathit{P\mathrm{\: =\: }\frac{F_{t}\times V}{\mathrm{3600}}}\: kW\: \cdot \cdot \cdot \left ( 1 \right )}$$Now, if 𝜼 is the efficiency of gear transmission, then the power output of motor (or power input to driving axles) is given ... Read More
In the plain rheostatic starting method, the voltage across the traction motor is gradually increased from zero to full line voltage and the current is kept constant at normal rated value by reducing the external resistance gradually.Let, 𝑇 = Starting period in seconds𝑉 = Line voltage in volts𝐼 = Constant current in amperesThen, at the instant of switching ON the supply, the back EMF produced by the motor is zero and it starts building up immediately as the motor starts rotating.At any instant, the supply voltage to the motor is equal to the back EMF developed by the motor plus ... Read More
In this article, we are going to learn how to clone a canvas using FabricJS. We can clone a canvas instance by using the clone() method. Usually, this is useful when we want to send our canvas instance remotely to somewhere else, it is usually a good idea to send the canvas instance clone in JSON form instead of sending the image of the canvas. clone() method helps us create a clone of any canvas instance along with its objects.Syntaxclone( callback: Object, propertiesToInclude: Array)ParametersCallback (optional) − This parameter is a callback function which is invoked with a clone.propertiesToInclude (optional) − ... Read More
In this article, we will take a look at the various methods used for starting and controlling the speed of DC series motors.Rheostatic ControlThe basic traction motor circuit with rheostatic starting is shown in the figure below.A DC series motor can be started by connecting an external resistance in series with the main circuit of the motor. At the starting instant, the back EMF developed by the motor is zero, thus the resistance connected in series with the motor is maximum and is of such a value that the voltage-drop across it with the full load rated current is equal ... Read More
In this article, we are going to learn how to customize the viewport of the canvas using FabricJS. Viewport is the area which is visible to user on the canvas. We can customize the viewport by using the viewportTransform property which allows us to control the transformation of the viewportSyntaxnew fabric.Canvas(element: HTMLElement|String, { viewportTransform: Array }: Object)Parameterselement − This parameter is the element itself which can be derived using Document.getElementById() or the id of the element itself. The FabricJS canvas will be initialized on this element.options (optional) − This parameter is an Object which provides additional customizations to ... Read More
In electric traction, the control equipment is required for −Connecting the motors to the supply mains without taking excessive current at start and provide smooth acceleration without causing sudden shock so as to avoid damage to the coupling.Adjusting the speed as per requirement.Providing rheostatic or regenerative braking.The master controller system is used in the electric traction work, where the currents to be dealt are too high for the equipment. In the master controller system, the contact instead of being made or broken by hand are closed or opened by the switches known as contactors.For closing and opening of these contactors, ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP